Closed oleksiyk closed 10 years ago
Without this small patch you will have to write things like:
var putObj = {
bucket: self.bucket,
key: self.key,
content: {
value: data,
content_type: 'binary/octet-stream'
}
}
if(self.vclock){
putObj.vclock = self.vclock;
}
return self.riak.put(putObj)
instead of
return self.riak.put({
bucket: self.bucket,
key: self.key,
vclock: self.vclock, // vclock might be undefined
content: {
value: data,
content_type: 'binary/octet-stream'
}
})
good call, thanks
There is probably no sense in wiring undefined fields in messages. Actually doing so breaks things up on Riak server:
Of course you can avoid sending undefined keys in application but its really easier to fix the problem in protobuf.js