Created
October 27, 2014 16:45
-
-
Save Natim/559a11123ac4b0042955 to your computer and use it in GitHub Desktop.
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
"""Delete all your couchdb database matching a pattern.""" | |
import requests | |
import urllib | |
for db in requests.get("http://localhost:5984/_all_dbs").json(): | |
print db, | |
if db.startswith("couchdb"): | |
print "DELETE", | |
r = requests.delete("http://localhost:5984/%s" % urllib.quote_plus(db)) | |
r.raise_for_status() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment