Hello!
I use Couchbase Lite .Net, Xamarin Android and C #.
I am developing a routine to treat CONFLICTS, following tips from a 
presentation by Jeff (I do not know if the name is correct).

According to my need, I need to always save the newest possible revision, 
as I do this? Since the structure of my documents I do not have a type 
attribute: Created in.
The revisions do not have date and time?
I noticed that conflicts are IEnumerable <SavedRevision> therefore always 
the last line would be the youngest?

Can anyone help?
Part of the code I'm using is this:

 private void myResolveConflict (Document doc, IEnumerable<SavedRevision> 
conflicts)
         {
             Dictionary<String,Object> mergeProps = myMergeRevisions (
conflicts);
             var current = doc.CurrentRevision;
             foreach (var rev in conflicts) {
                 var newRev = rev.CreateRevision ();
                 if (rev == current) {
                     newRev.SetProperties (mergeProps);
                 } else {
                     newRev.IsDeletion = true;
                 }
                 newRev.Save ();
             }
         } 

Julio.

-- 
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/7ec0fb3c-6b78-473c-aa66-00d7b86d7f36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to