Unable to connect through cluster

after hitting this command in mongo shell getting this error mentioned 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/aggregations?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

error generating after copying uncaught exception: SyntaxError: unexpected token: string literal :

The connect string is fine.I can connect

Show us the screenshot of how you ran the command
One possibility is you are already at mongo prompt.Reason you are getting syntax error or quotes could be the issue

Exit from mongo prompt (>) and run the command from os prompt

1 Like

where exactly i have to run this command in cmd? any specific directory?

got it thanks!! and please ask the teacher to at least give a proper explanation or to attach a document regarding all this. It creates a problem with the student new to mongodb

for every one who is having problem in connecting to the atlus server. just go to the bin folder where your mongodb.exe file exists open that directory in the command prompt and then paste the command given in that first lecture.

Good you were able to resolve the issue
You don’t have to be in bin directory to run the command if you have updated mongodb/bin to your PATH
You can run mongo/mongod commands from any directory

I would recommend setting up VS Code. Refer to this for the setup process.

Connecting M121 Atlas to Visual Studio Code

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.