You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by macario <ma...@gmail.com> on 2009/05/20 10:13:05 UTC

Deleting a buch of documents with a single request without knowing the ids?

Hi,

I am working on a Ruby client and I'm trying to do many to many
relationships between documents with a joint document establishing the
relationship between them, my problem is updating the joint documents.

The joint document contains the id for both documents so when I first save
the related documents I allso save the joint doc for each relationship by
now the id is generated by CouchDB.

If I want to update the relationships I would first need to generate a view
for getting the ids for the relationships between the docs and then bulk
delete them while updating the attributes for related docs and that makes a
GET request and a POST request. So the question is can I delete all
relationship documents that match certain conditions without knowing the ids
prior to posting the new ones? Sort of like using a view. It would still
make two requests but I wouldn't care about the first response. What other
alternatives people has come up with for many to many relationships apart
from the listed on the wiki?

Thanks