Deleting bins by setting values to null

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

Synopsis

This runbook describe the two cases of deleting bin by setting its value to null.

Solution:

There can be two cases of deleting a bin by setting value to null : Write-update or Write-replace.

Write-Update:

In write-update situation (the default behavior), the previous version of the record will be read in, each bin will be updated with the incoming bin values (null bins will be removed as a result, the database does not store null data), and then the new record is written out again. After that, defragmentation works as usual and claims back the older version of the record.

Write-Replace:

As an aside, if you do not need any bins from the previous version, you can do a write-replace, which will skip “reading the old version”.

For reference please See: http://www.aerospike.com/apidocs/java/com/aerospike/client/policy/RecordExistsAction.html

http://www.aerospike.com/java_api/com/aerospike/client/policy/RecordExistsAction.html