Consider the following code:
log.on('add', function (node) {
console.log(node.value)
})
If the node was inserted locally, node.value will be the literal object that was added. If it was inserted and received remotely via replication, it will be a Buffer object that needs to be converted to a string and JSON.parse()d.
The encoding of the node's value ought to be consistent regardless of where it came from. I think we'll break somebody's code either way, so I'd be happier seeing it default to the former (raw value, not a buffer).
Consider the following code:
If the node was inserted locally,
node.valuewill be the literal object that was added. If it was inserted and received remotely via replication, it will be aBufferobject that needs to be converted to a string andJSON.parse()d.The encoding of the node's value ought to be consistent regardless of where it came from. I think we'll break somebody's code either way, so I'd be happier seeing it default to the former (raw value, not a buffer).