I followed the MongoDB Docs to run my MongoDB in macOS,
When I start MongoDB using the terminal get this error:
Shutting down with code: 62
Delete the data directory where MongoDB stored and create again.
rmdir data
And:
mkdir data/db
Error code 62:MongoDB dbpath doesn't support the current version
Removing data director is not an optimal
solution. The best solution would be to upgrade to the higher version.
Else take the dump & restore the complete database on a fresh instance with a higher version.
mongodump --db employee --out /path/
mongorestore /path/employee/
Hope this helps !!!
This has worked for me
Initially i was facing various issues, like when i tried to start the server by using:
mongod
I received this error: shutting down with code 100
and then i tried to start by
sudo mongod
I received this error: shutting down with code 62
finally this command helped me to get rid of various issues
sudo mongod --repair
Now mongod server is running tentatively
sudo mongod
Please ensure if you are upgrading MongoDB, your featureCompatibilityVersion version is correct. I faced similar problem, after updating featureCompatibilityVersion to the correct version, it worked fine.
Reference: https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion/