When upgrading any software it's usually a good idea to check the manual first, and read something like this:
To upgrade an existing MongoDB deployment to 3.6, you must be running
a 3.4-series release.
To upgrade from a version earlier than the 3.4-series, you must
successively upgrade major releases until you have upgraded to
3.4-series. For example, if ...