Hi Raj
2018-05-26T19:22:05.396+0530 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:6
Could you run the mongo
shell command using the --norc
parameter?
If you can connect without any issue, you may want to take a look at your ~/.mongorc.js
(in Unix systems) file and check it for errors — a missing semicolon from the error message. See the mongorc.js page for more information.
If you still having errors, please post the complete shell output you’re seeing from mongo
invocation up to the error.
Best regards
Kevin
Hi Raj
The mongo
shell is a Javascript interpreter. Trying to type mongo <server address> <additional parameters>
inside the shell is a syntax error (it is not a Javascript statement or any supported command). This is the source of the SyntaxError: missing ; before statement
output.
There are more details in the mongo
shell page regarding the shell.
To connect to your Atlas instance, you should type at the command prompt:
C:\Users\user> mongo "mongodb://<your Atlas deployment address>" --ssl --authenticationDatabase admin --username <your username> --password <PASSWORD>
I would also recommend you to peruse the free courses at the MongoDB University, e.g. M001 which is a thorough introduction to MongoDB. The next session will start at 5 June.
Best regards
Kevin
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/100YWeatherSmall?replicaSet=Cluster0-shard-0>" --ssl --authenticationDatabase admin --username <m001-student> --password <m001-mongodb-basics
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
MongoDB Enterprise Cluster0-shard-0:PRIMARY>