couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject Re: What happens with a document, if a conflict is not resolved?
Date Sun, 01 Nov 2009 11:27:36 GMT
On Fri, Oct 30, 2009 at 08:37:36PM -0400, Adam Kocoloski wrote:
> The response format is a slightly awkward Array -- I believe the first  
> revision is the winning one.

This is definitely not true. For example, I can get the database into a
state where there are three conflicting versions, and the winning version
is the middle one returned by open_revs=all

$ curl http://127.0.0.1:5984/conflict_test/test?conflicts=true
{"_id":"test","_rev":"10-ca7d1f8bc31d20ad4898e4024547c4c6","hello":"baz","_conflicts":["9-9b4928288c4fc3087833549752bdcdc3","9-2438fa9601119c8fe2c0b2f4a688f65f"]}
$ curl http://127.0.0.1:5984/conflict_test/test?open_revs=all
[{"ok":{"_id":"test","_rev":"9-2438fa9601119c8fe2c0b2f4a688f65f","hello":"bar"}},
{"ok":{"_id":"test","_rev":"10-ca7d1f8bc31d20ad4898e4024547c4c6","hello":"baz"}},
{"ok":{"_id":"test","_rev":"9-9b4928288c4fc3087833549752bdcdc3","hello":"foo"}}]

Code to do this is attached.

Regards,

Brian.

Mime
View raw message