You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by faust 1111 <fa...@gmail.com> on 2010/03/24 10:02:22 UTC
Can i update many docs in one request?
Hi guy`s
i want ask about
in sql
UPDATE users SET name = 'Crazy' WHERE name == 'Song';
can i do like this in couch?
Thanks
Re: Can i update many docs in one request?
Posted by Paul Davis <pa...@gmail.com>.
Not directly.
The CouchDB pattern would be something like:
1. Define a view that allows you to fetch the docs you want.
2. Fetch the docs, possibly using ?include_docs=true
3. Update the docs in the client
4. Push all the docs back using _bulk_docs
If you have a lot of docs that are going to push RAM limits, you can
restructure things a bit but making the view not list docs that have
been updated. Then just loop over steps 2-4 taking the first N docs
that you feel comfortable working with at once.
HTH,
Paul Davis
On Wed, Mar 24, 2010 at 5:02 AM, faust 1111 <fa...@gmail.com> wrote:
> Hi guy`s
> i want ask about
> in sql
> UPDATE users SET name = 'Crazy' WHERE name == 'Song';
> can i do like this in couch?
>
> Thanks
>