Error while Connecting to Our Class Atlas Cluster from the mongo Shell

hi,
I am facing below error while connecting atlas cluster from mongo shell. please help me
MongoDB shell version v4.2.7

mongo “mongodb+srv://cluster0-jxeqq.mongodb.net/test” --username m001-student -password m001-mongodb- mongo “mongodb+srv://cluster0-jxeqq.mongodb.net/test” --username m001-student -password m001-mongodb-basics
2020-06-02T14:42:52.947+0100 E QUERY [js] uncaught exception: SyntaxError: unexpected token: string literal :
@(shell):1:6
mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
2020-06-02T14:43:15.147+0100 E QUERY [js] uncaught exception: SyntaxError: unexpected token: string literal :
@(shell):1:6

Please provide a screenshot of what you are doing. Because what you are doing depends of where you are doing it. I suspect that you are doing that at the wrong place. A lot of people had the same syntax error while doing what you were doing and they were all doing it at the wrong place. You should always search the forum to see if your issue has already been discussed and resolved.

Hi @pavankumar_24237,

It looks like that you have typed the same connection string twice. Also you are running this command inside the mongo shell.

Please exit out of the mongo shell by running exit command and then run the mongo command at the OS prompt.

~ Shubham

1 Like