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 127.0.0.1 # connect to default port
MongoDB shell version: 2.4.9
connecting to: 127.0.0.1/test
> show dbs
AWESOME_DB 0.203125GB
local 0.078125GB
> use AWESOME_DB;
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.

Advertisements

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s