What is <dbname> in the connection string?

I’m not able to find the dbname, the string which i got for connection is like
mongo “mongodb+srv://sandbox.ncybb.mongodb.net/” --username m001-student
now what should i use in place of .
Capture

I have the same question. With entering test as DBname I am not able to connect to the sandbox

I get a connection refused error:

DNSHostNotFound: Failed to look up service “_mongodb._tcp.sandbox.------.mongodb.net”: Connection refused

Yeah same issue with me! Hope anyone will look at it and give us the solution for it.

Was able to resolve the problem. updated the system dns servers to 8.8.8.8 and worked after.

Will try it, thanks for this! Happy learning

Normaly this is the database (admin) where the user is saved in. Could you try this and correct me if I am wrong. Did you try this with compass before?

How did you update it exactly? @Faraz_Arshad @Naman_Jain

@Debaditya_Mitra on a Mac I found the settings in System Preferences - Network - Advanced- DNS - DNS Servers

Hope it helps :slightly_smiling_face:

1 Like

@Naman_Jain dbname is actually optional, if you don’t specify dbname, your connection will default to “test” db
mongo “mongodb+srv://sandbox.ncybb.mongodb.net/” --username m001-student -p
MongoDB shell version v4.4.0
connecting to: mongodb://sandbox-shard-00-00.ncybb.mongodb.net:27017 …

MongoDB Enterprise atlas-6nhyx4-shard-0:PRIMARY> db
test

1 Like

to be able to use of mongo+srv URL’s your ISP’s DNS should support +SRV protocol, which most don’t yet. As @Faraz_Arshad did, you’ll need to change your DNS setting to point to a DNS server that supports it like google dns(8.8.8.8, 4.4.4.4) or opendns. this is actually mentioned in the lecture note

1 Like

I think the reason not doing for me is because I could figure it out my Substring…XXXX?

It is the DB which you want to connect to like video etc
For now you can put it as test.Even if you leave it blank as explained by Jefferson_Fermo it will connect you to test DB

Would you please help me find these 5 characters XXXX?

The db name is M001. The query will be
mongo “mongodb+srv://sandbox.ncybb.mongodb.net/M001” --username m001-student

1 Like

Hi Taha I was wondering if you tell me where can I get this “ncybb” five character substring in my account?

That would be for your own cluster. Not for Medhanie_Gebru.

Hope this helps

1 Like

Thank you Taha problem solved

You’re welcome

Please share the connection string you used to solve the problem.