I am able to connect from Compass. But from Mongo Shell frequently it gives this error. I have already whitelisted the IP.
D:\M001>mongo “mongodb+srv://cluster0-7d8v1.mongodb.net/test” --username m001-student -p m001-mongodb-basics
MongoDB shell version v4.2.0
connecting to: mongodb://cluster0-shard-00-00-7d8v1.mongodb.net:27017,cluster0-shard-00-01-7d8v1.mongodb.net:27017,cluster0-shard-00-02-7d8v1.mongodb.net:27017/test?compressors=disabled&gssapiServiceName=mongodb&ssl=true
*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.
2019-09-09T06:38:21.489+0530 E QUERY [js] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2019-09-09T06:38:21.507+0530 F - [main] exception: connect failed
2019-09-09T06:38:21.508+0530 E - [main] exiting with code 1