couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Chris Anderson <jch...@gmail.com>
Subject Re: bulk Updates
Date Sat, 27 Mar 2010 21:14:08 GMT

On Mar 24, 2010, at 5:03 PM, faust 1111 wrote:

> if i follow
> 
> 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
> 
> its will be to slow in my case
> i have contents with authors:
> content {
>  authors: [
>     {name: 'Lara', slug: 23424},
>     {name: 'Dimon', slug: 23445}
>  ]
> }
> 
> if author change name i must fetch 2000 docs and by hand change author
> name in each doc

With a large number of matching docs, you'll want to do the updates in batches. If you have
a view query that the asynchronous process is trying to empty, you can easily cope with updates
that come in later (after the first pass of the batch is complete) by rerunning old rename
queries a for some time window after the preference is updated.

I know it's not as simple as a SQL update, but it is compatible with multi-master replication
and offline editing.

Chris

> this is crazy job guy`s.
> 
> May be i`am thinking in wrong way?
> please help.


Mime
View raw message