Connecting to Atlas cluster

Hi, To connect to Atlas cluster where do i type this command. Is it in command prompt? Its not working.
$mongo “mongodb://,,” –


Please provide a screenshot of the issue.

Hi @sharath_chandra_N_A,

If you are still facing this issue then please share the information requested by @steevej-1495 :point_down:

~ Shubham

sorry for the late reply. I changed the path and I was able to execute the command but i am below error.

2020-09-20T06:31:58.870-0600 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set cluster0-shard-0

*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

2020-09-20T06:31:58.875-0600 E QUERY [js] Error: connect failed to replica set cluster0-shard-0/,, :
2020-09-20T06:31:58.890-0600 F - [main] exception: connect failed
2020-09-20T06:31:58.890-0600 E - [main] exiting with code 1

do not truncate he screenshot, we do not see the command that you typed. most likely you have entered the wrong user name or password, or your firewall or vpn prevents you from going at the provided addresses.

mongo “mongodb://,,” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

this is the command that I used.

same information so i did not paste here

Hi @sharath_chandra_N_A,

Please try to use any of the following connection strings :

mongo "mongodb+srv://" --username m001-student --password m001-mongodb-basics

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