Skip to content

Instantly share code, notes, and snippets.

@nelhage
Created November 22, 2013 00:30
Show Gist options
  • Save nelhage/7592567 to your computer and use it in GitHub Desktop.
Save nelhage/7592567 to your computer and use it in GitHub Desktop.
mongo = db.getMongo();
dbs = mongo.getDB('admin').runCommand({listDatabases: 1});
dbs.databases.forEach(function (d) {
if (/^_test/.test(d.name)) {
printjsononeline({dropping: d.name});
mongo.getDB(d.name).dropDatabase()
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment