mongodb

Mongodb : why show dbs does not show my databases?


I have setup mongodb 64bits on Windows. I ran server and client successfully.

But when I type:

show dbs

Output is

local  0.000GB

Why? show dbs is supposed to list all databases, at least the default one "test". Am I wrong?


Solution

  • Although you may be in the test database by default, the database does not actually get created until you insert a document into a collection in the database which will implicitly create the collection and the database.