Created
January 28, 2016 09:20
-
-
Save sekmet/912e2071ddcf96c64e3d to your computer and use it in GitHub Desktop.
Delete everything in a MongoDB database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use <whichever database> | |
db.getCollectionNames().forEach(function(c) { if (c.indexOf("system.") == -1) db[c].drop(); }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment