Skip to content

Instantly share code, notes, and snippets.

@OctavioBR
Created September 26, 2014 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OctavioBR/d03a5619a4deede23117 to your computer and use it in GitHub Desktop.
Save OctavioBR/d03a5619a4deede23117 to your computer and use it in GitHub Desktop.
regExp = /collectionPrefix_*/;
db.getCollectionNames().filter(function(name){
return name.match(regExp)
}).forEach(function(name){
db.getCollection(name).drop()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment