Skip to content

Instantly share code, notes, and snippets.

@meonkeys
Created February 6, 2012 19:46
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 meonkeys/1754355 to your computer and use it in GitHub Desktop.
Save meonkeys/1754355 to your computer and use it in GitHub Desktop.
var dbs = db.getMongo().getDBNames();
for(var i = 0; i < dbs.length; i++){
print("dropping " + dbs[i]);
db = db.getSiblingDB(dbs[i]);
db.dropDatabase();
}
// see also: http://stackoverflow.com/questions/4727127/mongodb-shell-scripting
// see also: http://stackoverflow.com/a/3010848/156060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment