Skip to content

Instantly share code, notes, and snippets.

@timusg
Created August 28, 2013 04:00
Show Gist options
  • Save timusg/6362027 to your computer and use it in GitHub Desktop.
Save timusg/6362027 to your computer and use it in GitHub Desktop.
delete collection by some query paarms
var collectionNames = db.getCollectionNames();
for(var i = 0, len = collectionNames.length; i < len ; i++){
var collectionName = collectionNames[i];
if(collectionName.indexOf('foo') == 0){
db[collectionName].drop()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment