Lab: Connect to your Atlas Cluster

Hi all!

I am a noob here who also happens to have very limited coding experience. And, if you would be kind enough to look past my audacity to still take on MongoDB: I would like to ask this question (- which unsurprisingly might be quite a dumb question to ask).

Anyway, I am not sure what I am doing wrong in the connection string over the IDE, while trying to connect to my Atlas cluster. And, I would truly appreciate if someone could point my mistakes out.

My connection string currently looks as follows:
mongo “mongodb+srv://Sandbox._____.mongodb.net/sample dataset” --username m001-student
password m001-mongodb-basics

Thanks in advance!

What error are you getting?
Show us the screenshot
Is DB name correct?
/sample dataset-You have space between two words

Hi, Ramachandra!

Thanks for caring to reply. Keeping your question on the database name in mind: I tried checking it with one of the available sample databases: sample_airbnb. And, the connection string I entered is the following (- the username has been replaced with underscores):

mongo “mongodb+srv://Sandbox.____.mongodb.net/sample_airbnb” --username m001-student --password m001-mongodb-basics

The following error still persists though:


Many thanks!

Have you completed all the steps in creating Sandbox cluster?
Share your exact string.You can change the password later

Hi!

Yes, prior to the lab exercise, I had successfully set up my Sandbox cluster.

Here is my exact string:

mongo “mongodb+srv://Sandbox.tkzbb.mongodb.net/sample_airbnb” --username m001-student --password m001-mongodb-basics

Thanks!

Your connect string looks fine and i am able to connect

Your test is failing as you used db_name in the string.Remove it and try
I think test results looking for exact string which you got after the setup
Eventhough we are able to connect to cluster successfully it is saying failed to connect to cluster

Post of screenshot of your mongo command.

Hi Ramachandra!

Thanks for the feedback.

Although I tried removing the db-name in the string: the same issue apparently persists. Just to be sure, this is my current string:

mongo “mongodb+srv://Sandbox.tkzbb.mongodb.net” --username m001-student --password m001-mongodb-basics

Addressing the second point you mentioned: could you kindly guide me how I may retrieve the exact string generated right after the cluster setup?

Thanks in advance!

Hey steevej-1495!

Thanks for responding to my query.

Capturing the screenshot is a bit of an issue given that the IDE window has horizontal scrollbar. So, I am just pasting below the strings I have tried so far (but to no avail):

mongo “mongodb+srv://Sandbox.tkzbb.mongodb.net/sample_airbnb” --username m001-student --password m001-mongodb-basics

mongo “mongodb+srv://Sandbox.tkzbb.mongodb.net” --username m001-student --password m001-mongodb-basics

And, this is the error which I have been encountering:

Thanks for your feedback in advance!

Please post screenshot of the terminal that show how you connected to your cluster.

You should see text as MongoDB Enterprise atlas-b38l53-shard-0:PRIMARY> at the end of the terminal. There is no point in running the test if you are not connected to your cluster.

Hi @steevej-1495!

This is the screenshot of my IDE terminal. I don’t think I see the text you have specified. I am guessing I am missing something here.

Please use test for db_name and try
Also don’t pass the password while connecting
I am suspecting this could be the reason why your test results is failing
When you create Sandbox cluster in Atlas you can see the string and it clearly says replace db_name with default DB and password is not given in the string
You have to run the command without password and it will prompt for pwd
Course instructors can clarify what all the conditions test result looks for

Hi @Ramachandra_37567!

I have tried that. Unfortunately, it is the same error again.

Thanks!

1 Like

Revise the lesson where the IDE is presented. You missed some fundamental concepts because you entered the mongo command in the file editing area.

Hi @Kumar_Arnavdeep,

In addition to @steevej-1495,

Can you please confirm the name of your cluster as well as the connection string that you see in Atlas for your cluster ?

It would be great if you could just share a screenshot of both.

Note: This is a public forum and other users can see the information that you are sharing here so please do not use this cluster for storing any of your personal data. Use this cluster only for the purpose of completing this course. Also, change the password for m001-student once we have resolved the issue.

~ Shubham

We do not understand

because this thread shows 3 different problems. Please post your question in a new thread. Provide a screenshot of what you are doing that shows the problem you are having.