You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's poorly documented, but CouchDB adds a _conflicts property to the doc object passed to a map function, when the document is in conflict. From the CouchDB wiki:
Views only get the winning revision of a document. However they do also get a _conflicts member if there are any conflicting revisions. This means you can write a view whose job is specifically to locate documents with conflicts. Here is a simple map function which achieves this:
function(doc) {
if (doc._conflicts) {
emit(null, [doc._rev].concat(doc._conflicts));
}
}
For compatibility it would be good to support this. I don't think it will affect performance: the SQLite engine already has to iterate over all the conflicting revisions, and the ForestDB engine has all the revisions readily available in the VersionedDoc object.
Note: We already support finding conflicts using _all_docs queries. In the REST API, add the query param ?include_conflicts=true or ?only_conflicts=true. In the native API use kCBLShowConflicts or kCBLOnlyConflicts. This is actually more convenient than having to create a special view just to find conflicts.
The text was updated successfully, but these errors were encountered:
I see you made some commits to the ForestDB storage engine in regards to this ticket, but not SQLite. Was SQLite already working? Or will it not be supported?
It's poorly documented, but CouchDB adds a
_conflicts
property to thedoc
object passed to a map function, when the document is in conflict. From the CouchDB wiki:For compatibility it would be good to support this. I don't think it will affect performance: the SQLite engine already has to iterate over all the conflicting revisions, and the ForestDB engine has all the revisions readily available in the
VersionedDoc
object.Note: We already support finding conflicts using
_all_docs
queries. In the REST API, add the query param?include_conflicts=true
or?only_conflicts=true
. In the native API usekCBLShowConflicts
orkCBLOnlyConflicts
. This is actually more convenient than having to create a special view just to find conflicts.The text was updated successfully, but these errors were encountered: