Error connecting to Windows shell

I am unable to run this command in windows 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/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
Getting below error :
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
2019-01-17T15:21:23.476+0530 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:6

Appreciate if someone can help me to resolve this error

I am able to connect just fine. Make sure you are not in the mongo shell already, exit the shell and then try the command again.

Kanika

hi,
Thanks it ran when I ran outside of the shell but getting this error now :
C:\Program Files\MongoDB\Server\3.6\bin>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 shell version v3.6.5
connecting to: 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
2019-01-20T21:11:13.061+0530 I NETWORK [thread1] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-01-20T21:11:24.288+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Socket recv() timeout 34.205.152.216:27017
2019-01-20T21:11:30.568+0530 I NETWORK [thread1] Successfully connected to cluster0-shard-00-02-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-02-jxeqq.mongodb.net:27017 with a 5 second timeout)
2019-01-20T21:11:34.257+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Successfully connected to cluster0-shard-00-00-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-00-jxeqq.mongodb.net:27017 with a 5 second timeout)
2019-01-20T21:11:35.727+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Unable to reach primary for set Cluster0-shard-0
2019-01-20T21:11:49.975+0530 I NETWORK [thread1] Successfully connected to cluster0-shard-00-01-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-01-jxeqq.mongodb.net:27017 with a 5 second timeout)
2019-01-20T21:12:42.509+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Socket recv() timeout 34.205.152.216:27017
2019-01-20T21:12:42.512+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] SocketException: remote: (NONE):0 error: SocketException socket exception [RECV_TIMEOUT] server [34.205.152.216:27017]
2019-01-20T21:12:42.524+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Detected bad connection created at 1547998900489366 microSec, clearing pool for cluster0-shard-00-01-jxeqq.mongodb.net:27017 of 0 connections
2019-01-20T21:12:42.527+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Dropping all pooled connections to cluster0-shard-00-01-jxeqq.mongodb.net:27017(with timeout of 5 seconds)
2019-01-20T21:12:42.538+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Ending connection to host cluster0-shard-00-01-jxeqq.mongodb.net:27017(with timeout of 5 seconds) due to bad connection status; 0 connections to that host remain open
2019-01-20T21:12:42.548+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Marking host cluster0-shard-00-01-jxeqq.mongodb.net:27017 as failed :: caused by :: HostUnreachable: network error while attempting to run command ‘ismaster’ on host ‘cluster0-shard-00-01-jxeqq.mongodb.net:27017
2019-01-20T21:12:47.555+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Socket recv() timeout 34.195.121.130:27017
2019-01-20T21:12:47.556+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] SocketException: remote: (NONE):0 error: SocketException socket exception [RECV_TIMEOUT] server [34.195.121.130:27017]
2019-01-20T21:12:47.558+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Detected bad connection created at 1547998889114759 microSec, clearing pool for cluster0-shard-00-00-jxeqq.mongodb.net:27017 of 0 connections
2019-01-20T21:12:47.562+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Dropping all pooled connections to cluster0-shard-00-00-jxeqq.mongodb.net:27017(with timeout of 5 seconds)
2019-01-20T21:12:47.563+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Ending connection to host cluster0-shard-00-00-jxeqq.mongodb.net:27017(with timeout of 5 seconds) due to bad connection status; 0 connections to that host remain open
2019-01-20T21:12:47.564+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Marking host cluster0-shard-00-00-jxeqq.mongodb.net:27017 as failed :: caused by :: HostUnreachable: network error while attempting to run command ‘ismaster’ on host ‘cluster0-shard-00-00-jxeqq.mongodb.net:27017
2019-01-20T21:12:48.718+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Unable to reach primary for set Cluster0-shard-0
2019-01-20T21:13:30.690+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] getaddrinfo(“cluster0-shard-00-01-jxeqq.mongodb.net”) failed: No such host is known.
2019-01-20T21:13:35.692+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Socket recv() timeout 52.4.238.74:27017
2019-01-20T21:13:35.692+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] SocketException: remote: (NONE):0 error: SocketException socket exception [RECV_TIMEOUT] server [52.4.238.74:27017]
2019-01-20T21:13:35.695+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Detected bad connection created at 1547998878369250 microSec, clearing pool for cluster0-shard-00-02-jxeqq.mongodb.net:27017 of 0 connections
2019-01-20T21:13:35.696+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Dropping all pooled connections to cluster0-shard-00-02-jxeqq.mongodb.net:27017(with timeout of 5 seconds)
2019-01-20T21:13:35.700+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Ending connection to host cluster0-shard-00-02-jxeqq.mongodb.net:27017(with timeout of 5 seconds) due to bad connection status; 0 connections to that host remain open
2019-01-20T21:13:35.701+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Marking host cluster0-shard-00-02-jxeqq.mongodb.net:27017 as failed :: caused by :: HostUnreachable: network error while attempting to run command ‘ismaster’ on host ‘cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-01-20T21:13:47.671+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] getaddrinfo(“cluster0-shard-00-00-jxeqq.mongodb.net”) failed: No such host is known.
2019-01-20T21:13:47.672+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Unable to reach primary for set Cluster0-shard-0
2019-01-20T21:13:47.674+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2019-01-20T21:14:29.496+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] getaddrinfo(“cluster0-shard-00-01-jxeqq.mongodb.net”) failed: No such host is known.
2019-01-20T21:14:41.310+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] getaddrinfo(“cluster0-shard-00-02-jxeqq.mongodb.net”) failed: No such host is known.
2019-01-20T21:14:53.126+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] getaddrinfo(“cluster0-shard-00-00-jxeqq.mongodb.net”) failed: No such host is known.
2019-01-20T21:14:53.127+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Unable to reach primary for set Cluster0-shard-0
2019-01-20T21:14:53.129+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.
2019-01-20T21:15:29.384+0530 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Failed to connect to 34.205.152.216:27017 after 5000ms milliseconds, giving up.
2019-01-20T21:15:40.009+0530 I NETWORK [thread1] Socket recv() An established connection was aborted by the software in your host machine. 34.205.152.216:27017
2019-01-20T21:15:40.027+0530 I NETWORK [thread1] SocketException: remote: (NONE):0 error: SocketException socket exception [RECV_ERROR] server [34.205.152.216:27017]
2019-01-20T21:15:40.057+0530 E QUERY [thread1] Error: error doing query: failed: network error while attempting to run command ‘buildinfo’ on host ‘cluster0-shard-00-01-jxeqq.mongodb.net:27017’ :
DB.prototype.runCommand@src/mongo/shell/db.js:168:1
DB.prototype.adminCommand@src/mongo/shell/db.js:186:16
DB.prototype.serverBuildInfo@src/mongo/shell/db.js:1221:16
DB.prototype.version@src/mongo/shell/db.js:1273:16
connect@src/mongo/shell/mongo.js:261:25
@(connect):1:6
exception: connect failed

Anand- Use the 3.6+ shell code instead.

getting error :
C:\Program Files\MongoDB\Server\3.6\bin>mongo "mongodb://cluster0-shard-00-00-jxeqq.mongo
MongoDB shell version v3.6.5
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongo
2019-01-21T15:44:00.317+0530 I NETWORK [thread1] getaddrinfo(“cluster0-shard-00-00-jxeqq.mongo”) failed: No such host is known.
2019-01-21T15:44:00.334+0530 E QUERY [thread1] Error: couldn’t initialize connection to host cluster0-shard-00-00-jxeqq.mongo, address is invalid :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed

Did you opened the port connections from all ? that is the step where you can find under connections.