Say I have a doc with two properties, "Start" and "End." One revision may have a time for Start and null for End, and vice versa. Rather than choosing a single revision as the winner, I want the final doc to contain the Start time from the revision where it is not null, and same for End.
Are there any best practices for handling this type of conflict resolution during a sync? Documentation I have found contains instructions for choosing a single revision as the winner, but I'd like to select values from multiple revs.
Examples specific to C#/MyCouch library would be great, but any general or other language advice is also much appreciated.
You cannot specify a custom way of conflict resolution during replication (a.k.a. sync). CouchDB automatically chooses the winning revision, and you cannot influence that:
You can wait for the replication to finish and handle conflicts afterwards, by performing application-specific merging of document revisions.
Looking into the documentation for Working with conflicting documents, I found the following pseudocode example: