Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Script to drop all databases on a mongodb instance

var mongo = db.getMongo(); mongo.getDBNames().forEach(function (dbname) { var db = mongo.getDB(dbname); db.dropDatabase(); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.