[Js] [SyntaxError: missing ; before statement @(shell)

mongo “mongodb://cluster0-shard-00-00-fkknv.mongodb.net:27017,cluster0-shard-00-01-fkknv.mongodb.net:27017,cluster0-shard-00-02-fkknv.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --ssl --authenticationDatabase admin --username dbAdmin --password *********

I ran the command as it shows in the ~Connect with mongo shell~ option and replaced the correctly but it returns -->
[Js] [SyntaxError: missing ; before statement @(shell)

Ive checked to connect with other cluster but the same follows Ive checked in StackOverflow but no good Answers were found
Any clues?

try to type


this will get you out of mongo shell.

then from command prompt you should be able to paste the whole command again and press enter.

Don’t worry about below.

Hi @ViTor_36053
it’s looks identical to mine, and mine came out ok. Have you tried changing your username and password?


I faced the similar issue while connecting to Atlas cluster through command shell. Solution provided above worked well. If you are still facing issue , try changing the database … from test to 100YWeatherSmall

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

I`ve reloaded the shell, worked.

Enviado do Outlook

1 Like