Not exactly sure what to call this, but in SQL I often find myself doing something like this while developing:
DELETE FROM people WHERE name == "John"
This is often used when I've just imported a bunch of data with a batch importer, and want to clear out a few results but not then entire data set. How do I go about doing this in CouchDB? I can easily make a map function
function(doc) {
if (doc.Name == "John")
emit(doc._id, null);
}
And then delete the returned _ids...but that would require me to write some sort of front-end app to take these _ids and perform the DELETEs. Sometimes my queries are much more complex, and would require a few queries, followed by a delete, followed by another query and an update.
What's the accepted method of doing this sort of map/delete and perhaps a map/update?