Created
July 15, 2016 06:59
-
-
Save masasdani/b13a5a453d62b64f3859f2389c1bd56c to your computer and use it in GitHub Desktop.
mongodb sample script
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
//this will remove all collection except system.* | |
use <name_of_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