Can anyone plz tell me how to know total number of conflicted documents in 
database via REST ? thanks in advance 

On Tuesday, January 7, 2014 at 11:31:20 PM UTC+5:30, jd04 wrote:
>
> Hi,
>
> We're in the middle of the development of a tool using Couchbase 
> Server/Sync/Lite (Android/Phonegap), for the classic example of multiple 
> devices replicating through the Sync Gateway. At the moment we're 
> attempting to manage some online/offline revisions of documents and 
> conflicts, but I've hit a wall.
>
> Here's the use case (both Devices on Continuous replication through the 
> Sync to the Server)
>
>    - Device A/B online
>    - Device A creates document 1
>    - Device A looses network connection
>    - Documents are replicated to Device B from Sync
>    - Device B makes new revision of document 1
>    - Device A, while offline, makes a new revision to document 1
>    - Device A regains network connection
>
> What I am seeing is the following:
>
>    - Server shows three revisions to document 1 - the initial document 
>    created by Device A, and the revision created by Device B, and the 
> revision 
>    created by A after regaining network (with revision by B "winning")
>    - Device A and B now have two documents (i.e. document 1) with the 
>    same ID. A GET on the document while on the devices returns the same as 
>    when on the Server.
>    - From the devices...
>
> sqlite> select * from docs where docid like '74%';
> select * from docs where docid like '74%';
> doc_id  docid
> 109     74fc4797-6f93-4fd3-b9af-3701784f3596
>
>
> sqlite> select * from revs where doc_id = 109;
> select * from revs where doc_id = 109;
> sequence        doc_id  revid   parent  current deleted json
> 224     109     1-17adec98-d34e-458a-b975-59526bd6c986          0       0 
>       {"test":"123"}
> 225     109     2-74af32aa-769c-4a6d-b8c2-06a425aafb55  224     1       0 
>       {"test":"999"}
> 226     109     2-a11653df-6049-4eb0-a00f-9b5abc2111c8  224     1       0 
>       {"test":"707070"}
>
>
> sqlite> select * from maps;
> select * from maps;
> view_id sequence        key     value
> 1       225     74fc4797-6f93-4fd3-b9af-3701784f3596   {"test":"999"}
> 1       226     74fc4797-6f93-4fd3-b9af-3701784f3596   {"test":"707070"}
>
> Map function
>
> function(doc) {
>     emit(doc._id, {
>       test: doc.test
>     });
> )
>
> Changes feed:
>
> {"seq":"public:365","id":"74fc4797-6f93-4fd3-b9af-3701784f3596","changes":[{"rev":"2-74af32aa-769c-4a6d-b8c2-06a425aafb55"}]}
>  
> ,{"seq":"public:366","id":"74fc4797-6f93-4fd3-b9af-3701784f3596","changes":[{"rev":"2-a11653df-6049-4eb0-a00f-9b5abc2111c8"}]}
>
>
> If I run that view on the CB Server through the UI - I am just returned 
> the single document, but on the devices, it returns both.
>
> Can anyone explain to me what is happening here? I have the feeling I may 
> be missing or confusing something fundamental with either the Sync Gateway, 
> the Changes feed sequences perhaps, or even the View map function.
>
> Would I be correct in saying that this is might be expected functionality? 
> And that I need a Map function on the devices to get these conflicts and 
> let the device user determine how to resolve?
>
>
> (Lastly, I'd like to thank the Couchbase guys involved with the 
> development of the product and support provided through here, both are 
> really excellent. )
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/367a60db-2d17-4781-984f-e183e175ecc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to