Skip to content

Instantly share code, notes, and snippets.

@thesmith
Created February 2, 2011 22:07
Show Gist options
  • Save thesmith/808555 to your computer and use it in GitHub Desktop.
Save thesmith/808555 to your computer and use it in GitHub Desktop.
Drop tmp MongoDB collections
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