MongoDB.live, free & fully virtual. Register Now MongoDB.live, free & fully virtual. Register Now

<dbname> in connection string

I’m about to start a MERN app but my skills were a bit rusty so I looked up several tutorials on how to start the project. However, I realized that I was stuck at this point when I logged in my MongoDB account which is on Atlas. There, I created a new project and then a cluster. I followed the steps like this tutorial (https://medium.com/@beaucarnes/learn-the-mern-stack-by-building-an-exercise-tracker-mern-tutorial-59c13c1237a1) said to get the connection string. However, the point that I’m stuck on is the <dbname> in the string which wasn’t in the example picture in the tutorial. So I’m confused. Do I need to create a database as well or what? What do I do for the <dbname> in the string?

Is there any other way to connect like using MongoDB Compass? I tried looking for tutorials that use Compass but I can’t find it…

In the tutorial:
https://miro.medium.com/max/1400/0*N3_DR7tYkTvJN1jv

My code screenshot:

Hello @Kristina_Bressler, welcome to the MongoDB community forum.

You can specify test as the <dbname>; this is the database to connect to. Within the application / Compass you can specify (or switch to) the database name you intend work with - the database will be switched to that database, then.

Also, see:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.