clojure-clutch / clutch

A Clojure library for Apache CouchDB.
Other
225 stars 37 forks source link

how would you do a bulk deletion? #73

Closed zcaudate closed 12 years ago

zcaudate commented 12 years ago

say I wanted to delete files over 3 months old or a list ids

i tried the method specified here: http://stackoverflow.com/questions/10404178/bulk-delete-in-couchdb

(ch/bulk-update *temp-db* [{:_id :1 :a 1} {:_id :2 :a 2} {:_id :3 :a 3}])
(ch/bulk-update *temp-db* [{:_id :1 :_deleted true} {:_id :2 :_deleted true} {:_id :3 :_deleted true}])

but i get a conflict message

cemerick commented 12 years ago

Each map needs a :_rev attribute, the same as with any singular update or delete operation. See the relevant CouchDB docs.