mongodbmongodb-compassstudio3t

Why is there a database named "test" when connecting MongoDB using Studio3T?


I'm learning MongoDB and trying to use Atlas. I created a remote cluster and tried to connect it using both MongoDB Compass and Studio 3T. However, I noticed that after connecting with Studio 3T, there was an empty database named "test" appearing in the left panel, below "admin" and "local" databases. Where did it come from? And how can I drop it? Because when I tried to drop this database, I got this error

    Mongo Server error (MongoCommandException): Command failed with error 8000 (AtlasError): 'user is not allowed to do action [dropDatabase] on [test.]' on server ac-bkmhuxm-shard-00-02.w2nutv2.mongodb.net:27017. 

The full response is:
{
    "ok" : 0.0,
    "errmsg" : "user is not allowed to do action [dropDatabase] on [test.]",
    "code" : 8000.0,
    "codeName" : "AtlasError"
}

After changing the roles in Atlas, I can now delete the database. However it keeps appearing when I make a new connection to MongoDB. Why is that?


Solution

  • Database test is the default database when you don't define anything.

    Databases local, admin and config are MongoDB system internal databases, you should not touch them unless advised by MongoDB support or special admin tasks.

    See also 3 default database in MongoDB