Created
February 2, 2011 22:07
-
-
Save thesmith/808555 to your computer and use it in GitHub Desktop.
Drop tmp MongoDB collections
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
var reg = new RegExp("^tmp"); | |
var names = db.getCollectionNames(); | |
for (var col in names) { var name = names[col]; if (name.match(reg)) { db[name].drop();} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment