Error while Connecting to Our Class Atlas Cluster from the mongo Shell

E QUERY [js] SyntaxError: invalid decrement operand @(shell):1:0

Please share the exact command you are using to connect. Here is the command I use to connect:

~$ mongo "mongodb://,," --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

Also, make sure you don’t run it from mongo shell, run from your Operating system.



hello good morning ,

Thanks for your response, it works successfully ! Actually I was running that command in mongodb shell .

1 Like

How do you find the replicaSet name to create the command? I had cluster0-shard-0 and it would not connect. Simply uppercasing the first letter to Cluster0-shard-0 did the trick.

Hi ,

from the UI i got this "mongo “mongodb://,,” --ssl --authenticationDatabase admin --username --password " and updated username and password as shown in the lecture like below
mongo “mongodb://,,” --ssl --authenticationDatabase admin --username m001-student --password m001-mongodb-basics

i am not able to conect. can any one please help

Akhil y

Hi @ayakhil,

Please share the error you are getting. Make sure you have your IP whitelisted and you are able to ping from your system.
Make sure user m001-student exists on your sandbox.


Hi Kanika,

This is the error what i am seeing
MongoDB shell version v4.1.8

Enter password:

connecting to: mongodb://,,

2019-03-04T20:02:22.192-0700 I NETWORK [js] Starting new replica set monitor for Sandbox-shard-0/,,

2019-03-04T20:02:22.193-0700 I ASIO [ReplicaSetMonitor-TaskExecutor] Connecting to

2019-03-04T20:02:22.193-0700 I ASIO [ReplicaSetMonitor-TaskExecutor] Connecting to

2019-03-04T20:02:22.193-0700 I ASIO [ReplicaSetMonitor-TaskExecutor] Connecting to

Implicit session: session { “id” : UUID(“dcca9375-d261-4cb3-afcb-8169aca140a2”) }

MongoDB server version: 4.0.6

WARNING: shell and server versions do not match

Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]

i was thinking to check again the course video but i am not able to access , it is showing 500 internal error

What are the permissions for the user: m001-student ?

These are just warning messages, you can continue with the shell.

The videos are back now, please check and let me know if you are still facing the issue.

Also, this is a development release, I will recommend downloading/installing 4.06 version.


I am not able to connect from my sandbox to mongo shell in my system
I am used the URL generated from Atlas

Did it work before or is it the first time you are trying?
Are you able to ping the host
May be some firewall or network issues preventing connection

i tried it after several times and it connected
Thank you