Ways of connecting to Atlas

Hello, I’ve noticed that in the video we go into our cluster and use the command that is there in to connect using the shell, which is:

mongo "mongodb+srv://sandbox.xxxxx.mongodb.net/<dbname>" --username m001-student

I have seen in every lecture of every chapter that down below in the Notes we have this way of connecting:
mongo "mongodb+srv://<username>:<password>@<cluster>.mongodb.net/admin"

  • Is this last one still working? what does go in cluster? “sandbox”? the “server id” (the one with xxxxx in the first one)?
  • What are the differences and how does that affect us?

Both will work
Giving example for Class cluster:

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

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

Modify your Sanbox connect string as per above format

1 Like

Thank you! I finally did it

In my case I had to adjust the cluster name from “@cluster-” to “@cluster.”
Had to put a . instead of -