Open gmaclennan opened 6 years ago
So, something like
db.put('/foo', 'bar', function () {
db.get('/foo', function (err, node) {
db.put([node], '/foo', 'baz')
})
})
Where you can explicitly replace one (or more?) nodes' values with a new one?
yes. I was thinking something like opts.links
in the hyperkv API
@mafintosh what do you think would be involved in this? I'm starting to get to a point in hyperdb-osm dev where this feature would be handy, and I'm keen to start thinking it through together, if you can make the time!
One idea is to specify an opts.links
in the style of hyperkv, but each link
is an object like
{
feed: <Buffer a0 c3 ff ...>
seq: 37
}
What I'm stymied on is: how do you encode this into the incremental index? Right now the implicit links work in two parts as I understand it:
node.clock
, andnode.prefix
.
Currently
db.put
will merge previous values for a key. It would be useful to be able to put to a specific head without merging. This would enable the user to delay decisions about merging until later. This would require that a property is exposed ondb.get
that allows the user to specify which record they are updating.