Update handlers just move the logic to the server side, they do not eliminate the possibility of conflicts.
B. On 9 November 2011 16:30, YIXIAO SHEN <[email protected]> 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 >
