Mongo shell issue

E QUERY [js] uncaught exception: SyntaxError: unexpected token: string literal

How do i solve this error, i want to connect the server with mongo shell?

What command are you running? Can you share that as well

1 Like

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

The intro command.

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

The intro command.

Hi @Titilope_Banjoko_68857,

It looks like that you are running this command inside the mongo shell itself. Please exit out of the mongo shell by running this command :

exit

Now connect to the class atlas cluster by running this command at your Operating System prompt :

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

Hope it helps!

Please let me know if the issue still persists.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

1 Like

@Shubham_Ranjan I had the same issue, been resolved. Thanks!

Hi @Paul_82595,

I’m glad your issue got resolved. Please let me know if you have any other issue.

Hi @Titilope_Banjoko_68857,

Please let me know if you are still having any issue.

Thanks,
Shubham Ranjan
Curriculum Services Engineer