Question

Where do I find my dbname for MongoDB connection string?

I'm trying to connect my app to mongodb, and I got a connection string from mongodb atlas, requiring me to replace username and password, which I get it, but it also says replace dbname with database name... I never remember I set up a db name, where do I find it? This is the connection string I have:

mongodb+srv://<username>:<password>@cluster0.pfose.mongodb.net/<dbname>?retryWrites=true&w=majority
 48  53964  48
1 Jan 1970

Solution

 47

By default, the <dbname> is test but to create your own dbname, you need to change the <dbname> to the name of database you're interested to use. MongoDB Atlas will automatically create the db for you based on the name.
For example: Creating a db for Qlabs with username=Que and password=pin123

mongodb+srv://Que:pin123@cluster0.pfose.mongodb.net/Qlabs?retryWrites=true&w=majority
2020-08-03

Solution

 18

For those who wanna create db in with GUI

enter image description here

2020-11-26