Delete entire database from mongo from cmd line

To quickly delete / remove a entire database from mongo you can use the command line interface:

volker@Volkers-MacBook-Pro ~> mongo # connect to default port
MongoDB shell version: 2.4.9
connecting to:
> show dbs
local 0.078125GB
switched to db AWESOME_DB
> db.dropDatabase();

By the way. If you’re using OS X and haven’t already installed MongoDB locally you could do it with homebrew in a matter of seconds.

About javavolker71

when i do not write posts on this blog, don't work on or try to break my code i'm spending a reasonable amount of time
This entry was posted in MongoDB, OS X and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s