Skip to content

Instantly share code, notes, and snippets.

@anarchivist
Created March 31, 2015 16:51
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 anarchivist/ba97611d13331ce78307 to your computer and use it in GitHub Desktop.
Save anarchivist/ba97611d13331ce78307 to your computer and use it in GitHub Desktop.
Deleting records in prod from CouchDB based on DPLA API results
curl "http://api.dp.la/v2/items?dataProvider=%22Leo+Baeck+Institute+Library+Periodical+Collection%22&api_key=$API_KEY&page_size=500" > /tmp/orig_lbi
cat /tmp/orig_lbi | jq '{"docs": [.docs[] | . + {"_deleted": true} | del(.score)]}' > /tmp/lbi_to_delete
curl -H "Content-Type: application/json" -X POST --data-binary @/tmp/lbi_to_delete "http://$USER:$PASS@$COUCHDB_HOST:5984/dpla/_bulk_docs" > /tmp/lbi_delete_response
# flush memcache and proxy cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment