Linked Questions
10 questions linked to/from Delete everything in a MongoDB database
945 votes
21 answers
543k views
How do I drop a MongoDB database from the command line?
What's the easiest way to do this from my bash prompt?
92 votes
6 answers
76k views
Mocking database in node.js?
How would I mock out the database in my node.js application, which in this case uses mongodb as the backend for a blog REST API ? Sure, I could set the database to a specific testing -database, but I ...
11 votes
2 answers
27k views
Numeric Collection Name Remove
How can you drop a numeric collection from MongoDB? PRIMARY> db.123456789011.remove({}); Tue Mar 20 08:42:51 SyntaxError: missing ; before statement (shell):1 PRIMARY> db.123456789011.drop({});...
11 votes
3 answers
25k views
Clear all entries in Docker mongodb?
Is there an easy way to clear a mongodb database running in docker? Or possibly delete it all and create it again?
7 votes
2 answers
6k views
Drop Collections in MongoDB Database
Is there a way to drop all the collections in a MongoDB database using one command, without needing to name each individual collection? From what I've found, it looks like the command to do this is ...
3 votes
2 answers
5k views
How to drop all databases in MongoDB?
I have a list of databases in my MongoDB. How to delete all databases except local, admin, and config?
3 votes
1 answer
7k views
Deleting MongoDB database and collections
I am having a space problem with mongoDB and my current ubuntu 12.04 desktop computer. I always used the default setting which means that the data is physically stored under /var/lib/mongodb. By the ...
3 votes
2 answers
3k views
In Mongodb: use remove or dropDatabase to empty a database? Or both?
I have a sensor hooked up to a Raspi, gathering data using Mongo. Every few days I copy the database (using mongodump) and then delete the Mongo files and restart the sensor. I have had some trouble ...
1 vote
2 answers
255 views
Unique field constraint not enforced after dropDatabase
I have a Node / Mongoose / MongoDB project which I use Selenium WebDriver for integration tests. Part of my testcase setup is to wipe the database before each test. I accomplish this via command line ...
0 votes
1 answer
73 views
Bluemix/CloudFoundry + Meteor - How to Project Reset?
When developing with Meteor locally, one execute meteor reset locally to refresh the database. Can one run this command on a production level app deployed on Bluemix without digging into the Mongo ...