Apologies if this has been asked before, but I can’t quite find a suitable explanation to help me.
I’m using CBL via the rest API. I’ve written a view to give me all the conflicts (because I couldn’t find any other way to do it - don’t think the docs are correct).
conflicts: {
"map": function(doc) {
if(doc._conflicts) {
emit(doc._conflicts, doc);
}
}.toString()
}
I’m getting a conflict back and want resolve it by just keeping the version thats on the server and discarding and local revision. I guess my first question is, how do I know which version is the winning server version?
Secondly. If I have been making many changes to a document in conflict and have several revisions I want to get rid of in order to get back to the server version - how do I delete them? is there an order in which I need to do it?
Or is there a shortcut? All I really want is the server version.
An example of the issues I’m having. I’ve got the following conflict and have tried separately to delete revisions 29 and 30, but on each attempt I just get a 409 response.
{ doc: null,
id: 'bd8f1839f60512ee0b0f8fd899b76e8d',
key: [ '2-30c3d2007a86d11b6c3283048965e33d' ],
value:
{ account_alias: '',
readers:
[ 'd64ffd61-57d2-474a-83c0-64da8bfe85e7',
'4c6302a5-609a-4be8-8ae4-f8c5f6b89671' ],
owner: 'd64ffd61-57d2-474a-83c0-64da8bfe85e7',
type: 'public-profile',
account_id: 'f31ce8439f35df4e47471e93593576ae',
_id: 'bd8f1839f60512ee0b0f8fd899b76e8d',
_rev: '2-92caefaa36001f6663e10cf0f9d88896',
_local_seq: 1015,
_conflicts: [ '2-30c3d2007a86d11b6c3283048965e33d' ] } }
If I query the sync_gateway direct I see its at version 5-0c…