Mongo db that does not exist but shows up in connection

2.8k Views Asked by At

I have dropped a MongoDB database called 'test' but when I connect to mongod it shows it in the connection. Please see the code below. Can you please help me understand what is going on? Is this a bug or I am missing something? Why is it that test is not in the list of databases when using show dbs command. Thanks for the help.

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Me>c:\mongodb\bin\mongo

MongoDB shell version: 2.4.8

connecting to: test

db

test

show dbs

local 0.078125GB

>

1

There are 1 best solutions below

0
On BEST ANSWER

Your show dbs output only has one db, local, which is created automatically. If you don't specify a database on startup the mongo shell defaults to test which is why you see "connecting to: test". The database test will not be created until you start inserting data into a collection in it.