Skip to content

Instantly share code, notes, and snippets.

@Natim
Created October 27, 2014 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Natim/559a11123ac4b0042955 to your computer and use it in GitHub Desktop.
Save Natim/559a11123ac4b0042955 to your computer and use it in GitHub Desktop.
"""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()
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment