Created
September 22, 2014 16:11
-
-
Save Voronenko/5457c8d41735c7094118 to your computer and use it in GitHub Desktop.
Removes all collections inside mongo DB except the system one
This file contains hidden or 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
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