Created
March 31, 2015 16:51
-
-
Save anarchivist/ba97611d13331ce78307 to your computer and use it in GitHub Desktop.
Deleting records in prod from CouchDB based on DPLA API results
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
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