Unable to connect to atlas cluster E QUERY [js] uncaught exception: SyntaxError: unexpected token: string literal : @(shell):1:6

I am facing the issue while connecting to atlas cluster from ubuntu machine. I opened the mongo shell, then I typed as per lesson instruction as below

> 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

but I got this below error
2019-09-07T13:20:45.836+0530 E QUERY [js] uncaught exception: SyntaxError: unexpected token: string literal :@(shell):1:6

Can anybody tell me how to solve this issue ,please ?

1 Like

I think you are already connected to mongo
exit and fire the command at os prompt

3 Likes

Hi @PyDev,

As @Ramachandra_37567 mentioned, You are already inside the mongo shell and that’s why when you are running this command it is throwing an error. You are expected to run this command from the terminal. To exit out of it please use the exit command.

exit

If you have any other query please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Yes I did it. Thank you