Could not connect to atlas from shell

mongo “mongodb+srv://cluster0-jxeqq.mongodb.net/test” --username m001-student -password m001-mongodb-basics

DNSHostNotFound: Failed to look up service “_mongodb._tcp.cluster0-jxeqq.mongodb.net”: Undefined error: 0

some one please help…

Please try this connect string

mongo “mongodb://m001-student:m001-mongodb-basics@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?authSource=admin&replicaSet=Cluster0-shard-0&ssl=true&readPreference=primary

1] 736
[2] 737
[3] 738
[2]- Done replicaSet=Cluster0-shard-0
[3]+ Done ssl=true
MongoDB shell version v4.0.17
exception: No digits

I used and I get something like this

Please try again.I can connect
It could be quotes or some space/invalid character issues in the string

Quotes fixed:

mongo "mongodb://m001-student:m001-mongodb-basics@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?authSource=admin&replicaSet=Cluster0-shard-0&ssl=true&readPreference=primary"

If it doesn’t work, share a screenshot.

thank you so much this worked …

sorry, just curious to know why did the connection string given in the course did not work?

Hi @PoornimaChinnaraj0909,

Not all DNS providers or routing systems support the SRV protocol and hence they fail to resolve the SRV record.

We have updated the lecture notes to add the Standard connection string in the lecture notes as well.

Thanks,
Shubham Ranjan
Curriculum Services Engineer