Created
January 15, 2018 10:05
-
-
Save alkampfergit/4f09ae6bc31429876fc2e2f7a488d27f to your computer and use it in GitHub Desktop.
Mongodb: Delete db starts with
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 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