couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: how to update multiple fields in a doc
Date Wed, 09 Nov 2011 16:58:10 GMT
Update handlers just move the logic to the server side, they do not
eliminate the possibility of conflicts.


On 9 November 2011 16:30, YIXIAO SHEN <> wrote:
> Hi all,
> I'm running a test on CouchDB, this test generates documents in CouchDB
> database and later randomly updates the documents. The parameter for the
> update is: id of the doc and map<key, value> that indicates the fields of
> the doc to update. It doesn't have any knowledge of the doc version and I
> retrieved this information from CouchDB before updating. This is slow and
> in multi-thread environment this approach causes a lot of update conflicts.
> I have been reading about the update handler and it seems to me that this
> could be a possible way to go. But I'm having difficulty to implement this
> update function, can anyone give me an example of how to write such a
> function that can update multiple fields in a document, the fields to be
> updated is not predefined but randomly specified by the test application.
> Thanks

View raw message