Aerospike:update not updating complex type


When changing the complex type on a record, aerospike:update doesn’t update the data. To make aerospike:update update the complex type the complex type first need to be cloned and then set to the record. Is this the default implementation or is it a bug?

– this doesn’t work[key] = value aerospike:update(topRec)

– this works = map.clone([key] = value aerospike:update(topRec)


I experienced the same problem when writing a generic library to mutate values in a list or map via a UDF (see Aerospike Labs ).

What you have to to is “touch” the bin so that the storage system knows that the bin needs updating in the record

try this code:

function add(topRec, key, value)
  if aerospike:exists(topRec)  then

    if == nil then = map()
    end[key] = val
    -- add this code to "touch the bin" =