My question is how do I do some simple things like:
1) Delete all documents where key.value = xxx

For #1, my current trick is to generate a view with a map function
that looks like this:

map: function(doc) {
   emit(null, doc._rev);
}

This makes it easy to convert the results of the view (without
stale=ok) into a bulk-delete by iterating over the view, but not
fetching each document to get at the revision.

Hmm, could you explain a bit how it should work? (Because the way I understand it, you have to iterate over _all_ the docs and check `if doc.value == xxx` in the client code? That'd be impossible for large data sets.)

As for the question 1), I'd either do a view to emit `[doc.value, 1]` or index it with fulltext, then get the results back (either querying with `key="xxx"` or `?q=key:xxx`) in batches of ~10.000, get the IDs and revisions and then issue a bulk delete.

2) Update all documents where key.value = xxx so value = yyy


There is no way to do 2), AFAIK. This is not entirely bad, neccessarily.


Karel

Reply via email to