Thanks @Tess_Sluijter, I should have been more careful.
@smlokhande, There are few things that you are missing here on the basics. With these you are all set:
- OS Shell: If you want to connect to Atlas cluster from your OS shell, then you don’t need to start
mongod process as Atlas is already doing that for you.
You just need a command to connect to your atlas cluster.
To do that, instead of using
mongo --nodb, just run the command from your OS shell and you will be connected to the Mongo shell.
mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,clu0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/100YWeatherSmall?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
And just to make things clear for you:
Note: You cannot change the database if you started the Mongo shell with
--nodb option. As this option prevents the shell from connecting to any database instances. To connect with the database from the same Mongo shell, look here. Best and easy way would be to disconnect and connect with appropriate connection parameters.