Skip to content

Instantly share code, notes, and snippets.

@queertypes
Created November 5, 2013 21:40
Show Gist options
  • Save queertypes/7326836 to your computer and use it in GitHub Desktop.
Save queertypes/7326836 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
try:
import pymongo
except ImportError:
print('error: missing `pymongo`: `pip install pymongo`')
quit()
import sys
remove_set = ['messages', 'queues', 'catalogue']
try:
conn = pymongo.MongoClient(sys.argv[1])
except Exception:
print('usage: {0} mongodb_uri'.format(sys.argv[0]))
quit()
for db in conn.database_names():
if any([(x in db) for x in remove_set]):
print('dropping {0}'.format(db))
conn.drop_database(db)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment