Deleting bins during multiple operation


I’m doing multiple operations on the record, using client.operate() method. During this proccess, some bins have to be deleted. As you know, you have to set bin value to null, to delete it, but when I’m trying to add to operations array something like ops.push(Aerospike.operator.write(binName, null)); I get an exception in client.operate() method Aug 09 2016 05:48:05 GMT: ERROR(24241) [] [operations_from_jsarray] - invalid operation [0] - result: -1 { [AerospikeError: Operations array invalid] name: 'AerospikeError', message: 'Operations array invalid', code: -2, func: 'OperateAsync', file: '../src/main/client/', line: 59 } Of course, when there are no “null-write” operations, they execute without any errors Is it a bug? If not, is it possible to overcome such behavior without using a bunch of single client.put() calls?


Hi @Cheriksoft,

Yes, this is indeed a bug! Aerospike.operator.write doesn’t handle null values correctly. It would be great if you could file an issue for this at Github: aerospike/aerospike-client-nodejs/issues. I will include a fix in the next release.

As a work-around, you can for now delete the bins by using Client#put to set the bin values to null, e.g.

const Aerospike = require('aerospike')
Aerospike.connect(function (err, client) {
  if (err) throw err
  var key = new Aerospike.Key('test', 'test', 'test')
  var update = { binToDelete: null }
  client.put(key, update, function (err) {
    if (err) throw err


Thanks, saw the new issue #142 you filed. Will include a fix in v2.3.0 soon.

Cheers, Jan


@Cheriksoft, Aerospike Node.js client v2.3.0, which was just released, includes the fix for writing a null value to a bin in order to delete the bin using the Client#operate command.

Cheers, Jan