Last active
November 4, 2015 17:12
-
-
Save fgm/6004f5de7cf6ecb94a49 to your computer and use it in GitHub Desktop.
Drop the MongoDB Simpletest collections from a Drupal 7 database
This file contains 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 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