Skip to content

Instantly share code, notes, and snippets.

@alkampfergit
Created January 15, 2018 10:05
Show Gist options
  • Save alkampfergit/4f09ae6bc31429876fc2e2f7a488d27f to your computer and use it in GitHub Desktop.
Save alkampfergit/4f09ae6bc31429876fc2e2f7a488d27f to your computer and use it in GitHub Desktop.
Mongodb: Delete db starts with
var dbs = db.getMongo().getDBNames()
for(var i in dbs){
db = db.getMongo().getDB( dbs[i] );
if (db.getName().startsWith('jarvis-support-test') )
{
print( "dropping db " + db.getName() );
db.dropDatabase();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment