Can't connect to Atlas

Hello, I am having the error below after pasting the command in the mongo shell:

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

2018-08-23T23:50:21.059+0300 E QUERY [js] SyntaxError: missing ; before statement @(shell):1:6

That command is used on the OS command line to log into mongo. You don’t need to execute it within the mongo shell.

1 Like

Hi,

As @steve16513 pointed out, it looks like you are running the command to connect to the Atlas instance from the Mongo Shell, try running the command from a regular shell.

José Carlos

1 Like

Thank you for your reply. But even when I try running it from my regular shell, it says " -bash: mongo: command not found" - Do you think there is something wrong with mongo installation? knowing that mongo runs correctly and the shell too.

Hi,

That is a different problem. It looks like the mongo binaries are not in your path. In your previous post you run your mongo shell and tried to connect to the Atlas instance from there. Try to run your mongo shell using all the parameters needed to connect to the Atlas instance.

José Carlos

1 Like

I solved the problem by putting mongo binaries in my path and connecting to Atlas from the terminal. Thank you for your help!

Glad you solved it!

José Carlos