I am developing a prototype website that works offline that utilises Pouch DB so that it syncs back up to a CouchDB on a server when it goes online.
The Pouch DB conflicts guide says:
To resolve the conflict, you simpy put() a new revision on top of the current winner.
How do you do this? I have the tried the following functions but neither work as expected:
function (current, chosen) {
chosen._rev = current._rev;
chosen._conflicts = [];
db.put(chosen);
};
function (chosen) {;
db.put(chosen);
};
The top function takes two documents:
- The document that is the current winner
- The document the user has selected to become the new winner.
I've read in some places (like here) that deleting the losing conflicts is necessary but I would rather not delete anything if possible, and the Pouch DB guide has no mention of this.