couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: Getting the current _rev in case of a 409
Date Tue, 28 May 2013 21:23:07 GMT

On May 28, 2013, at 9:29 AM, Mark Hahn <> wrote:

> I don't like designers telling me how write my program.  

Any API is in some sense telling you how to write your program, by making some things easy
and other things difficult.

> I have a large app
> that does this all the time.  The proper execution doesn't care at
> all about collisions.  This is causing me headaches for no reason.

Then write a quick function that uses a while loop to get the current version, store the new
version based on the current version’s _rev, and retry in case of a race condition. Call
that instead of doing a direct PUT.

View raw message