Skip to content

Instantly share code, notes, and snippets.

@fgm
Last active November 4, 2015 17:12
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 fgm/6004f5de7cf6ecb94a49 to your computer and use it in GitHub Desktop.
Save fgm/6004f5de7cf6ecb94a49 to your computer and use it in GitHub Desktop.
Drop the MongoDB Simpletest collections from a Drupal 7 database
var collections = db.getCollectionNames();
collections.forEach(function(e) {
if (e.match(/^simpletest/)) {
db[e].drop();
}
});
// And the one-liner version, simple to paste.
db.getCollectionNames().forEach(function(e) { if (e.match(/^simpletest/)) { db[e].drop();}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment