Can't connect to mongodb cluster from dos

C:\Users\shaurya>mongo “mongodb+srv://shaurya-gvp6g.mongodb.net/test” --username m001-student
MongoDB shell version v3.4.20
connecting to: mongodb://mongodb%2Bsrv:/%2Fshaurya-gvp6g.mongodb.net%2Ftest
2019-03-25T22:38:10.907+0530 E QUERY [thread1] Error: No digits :
connect@src/mongo/shell/mongo.js:240:13
@(connect):1:6
exception: connect failed

Try this way
C:\Users>mongo “mongodb+srv://shaurya-gvp6g.mongodb.net/test” --authenticationDatabase admin --ssl --username m001-student --password
MongoDB shell version v4.0.5
Enter password:

Still getting same error

C:\Users\shaurya>mongo “mongodb+srv://shaurya-gvp6g.mongodb.net/test” --authenticationDatabase admin --ssl --username m001-student --password
MongoDB shell version v3.4.20
Enter password:
connecting to: mongodb://mongodb%2Bsrv:/%2Fshaurya-gvp6g.mongodb.net%2Ftest
2019-03-26T20:26:45.170+0530 E QUERY [thread1] Error: No digits :
connect@src/mongo/shell/mongo.js:240:13
@(connect):1:6
exception: connect failed

I am able to connect.

C:\Users\ramrt>mongo “mongodb+srv://shaurya-gvp6g.mongodb.net/test” --authenticationDatabase admin --ssl --username m001-student --password
MongoDB shell version v4.0.5
Enter password:
connecting to: mongodb://shaurya-shard-00-00-gvp6g.mongodb.net.:27017,shaurya-shard-00-01-gvp6g.mongodb.net.:27017,shaurya-shard-00-02-gvp6g.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Shaurya-shard-0&ssl=true
2019-03-26T21:14:22.278+0530 I NETWORK [js] Starting new replica set monitor for Shaurya-shard-0/shaurya-shard-00-00-gvp6g.mongodb.net.:27017,shaurya-shard-00-01-gvp6g.mongodb.net.:27017,shaurya-shard-00-02-gvp6g.mongodb.net.:27017
2019-03-26T21:14:22.489+0530 I NETWORK [js] Successfully connected to shaurya-shard-00-02-gvp6g.mongodb.net.:27017 (1 connections now open to shaurya-shard-00-02-gvp6g.mongodb.net.:27017 with a 5 second timeout)
2019-03-26T21:14:22.493+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to shaurya-shard-00-00-gvp6g.mongodb.net.:27017 (1 connections now open to shaurya-shard-00-00-gvp6g.mongodb.net.:27017 with a 5 second timeout)
2019-03-26T21:14:22.526+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] changing hosts to Shaurya-shard-0/shaurya-shard-00-00-gvp6g.mongodb.net:27017,shaurya-shard-00-01-gvp6g.mongodb.net:27017,shaurya-shard-00-02-gvp6g.mongodb.net:27017 from Shaurya-shard-0/shaurya-shard-00-00-gvp6g.mongodb.net.:27017,shaurya-shard-00-01-gvp6g.mongodb.net.:27017,shaurya-shard-00-02-gvp6g.mongodb.net.:27017
2019-03-26T21:14:22.662+0530 I NETWORK [js] Successfully connected to shaurya-shard-00-00-gvp6g.mongodb.net:27017 (1 connections now open to shaurya-shard-00-00-gvp6g.mongodb.net:27017 with a 5 second timeout)
2019-03-26T21:14:22.670+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to shaurya-shard-00-01-gvp6g.mongodb.net:27017 (1 connections now open to shaurya-shard-00-01-gvp6g.mongodb.net:27017 with a 5 second timeout)
2019-03-26T21:14:22.840+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to shaurya-shard-00-02-gvp6g.mongodb.net:27017 (1 connections now open to shaurya-shard-00-02-gvp6g.mongodb.net:27017 with a 5 second timeout)
Implicit session: session { “id” : UUID(“c97e169e-eeb5-4676-9be3-3b2f6cdea8df”) }
MongoDB server version: 4.0.6
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise Shaurya-shard-0:PRIMARY> db
test
MongoDB Enterprise Shaurya-shard-0:PRIMARY>

What is the reason I am not able to connect

I suspect some permission issues for your user
Please check this if it helps


I don’t use Windows so not able to help further
Course instructors can help you

Please update MongoDB shell. Its recommended to use the latest version. Download here:

https://www.mongodb.com/download-center/community

Kanika