incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilbert B Garza" <gilbertbga...@gmail.com>
Subject Re: Bulk insert conflicts
Date Fri, 25 Jul 2008 17:20:24 GMT
On Fri, Jul 25, 2008 at 11:16 AM, Michael Hendricks <michael@ndrix.org>
wrote:

> The current bulk_docs behavior of failing the entire operation when one
> part fails is a very useful feature though.  It allows for limited
> transactions.  I use the bulk_docs feature to maintain the database in a
> consistent state when I need to delete one document and create another
> one.  If either operation fails, I know that the entire bulk_docs
> request will fail and the database will still be in a consistent state.
>
> Perhaps using something like this as the body of the 412 response:
>
>    {
>    "ok":false,
>     "conflict_revs": [
>        {"id": "0", "attempted_rev": "1001", "current_rev": "1002"},
>        {"id": "2", "attempted_rev": "5000", "current_rev": "5002"}
>    ]
>    }
>
> I removed "conflicts":true since that can be inferred from the presence
> of conflicted_revs.
>
> --
> Michael


That's true, I didn't think about transactions. That's much more useful than
following through with missing conflicted docs.

I like your solution much better than mine, Michael.  +1

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message