No test database is shown in the Compass


I was able to connect to Atlas cluster from both Compass and Mongo Shell.
I ran the following command, which connects me to test database:
mongo "mongodb+srv://" --username m001-student -password m001-mongodb-basics
However, I cannot see any database named test in compass. Is it possible to connect to a database that does not exist yet, or am I missing something?

Here is the screenshot of the Compass:

Hi @Omer_Toraman,

Test is a default database and by default it’s empty and that’s why you are not seeing it listed in Compass.

In theory, you can connect to a non-existent database by specifying it’s name in the connection string. But as soon as you insert data into it, an actual database and collection will get created. Until then it acts like a place holder.

Hope it helps!

~ Shubham

You should trim databases name, which is “test” in that connection string.
It should change from this:

mongo “mongodb+srv://” --username m001-student -password m001-mongodb-basics`

to this:

mongo "mongodb+srv://" --username m001-student -password m001-mongodb-basics

Hi @Alejandro_Ramirez,

When you don’t specify the name of the database in the connection string then by default it will connect you to the test database.

Try this :

  • Connect to the cluster using the connection string that you have shared.

    mongo "mongodb+srv://" --username m001-student -password m001-mongodb-basics

  • After you have successfully connected to the cluster, run this command and check the output :

~ Shubham