Upgrading Mongodb from 3.2.6 to 4.2. Which is the better way to do it? What is the best way to upgrade MongoDB?

Say I have 3.2.6 and I want to upgrade to 4.2

Can I just use mongodump and mongorestore? Or are there any intricacies to it?
I would follow one of these documents that are published by MongoDB.


Upgrade a Replica Set to 4.2
Upgrade a Standalone to 4.2