digidem / osm-p2p-db

Peer-to-peer database for OpenStreetMap data
BSD 2-Clause "Simplified" License
237 stars 25 forks source link

Modifying a fork without merging conflict #8

Closed gmaclennan closed 8 years ago

gmaclennan commented 8 years ago

From the readme 'To merge these "conflicts" back into a single value, use osm.put(id, doc, cb) to store the desired document value.'

How do you update a doc that has a fork without merging? I can think of several scenarios where a user would need to update a forked doc (i.e. update one of the forks) and postpone dealing with merging / resolving conflicts.

ghost commented 8 years ago

You can give put() an array of opts.links to point back at. If opts.links isn't defined, the default value is the most recent set of updates. This behavior is documented in hyperkv, but the explanation could be moved inline into the osm-p2p-db docs.