FAQ Calling as_map_destroy

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.

FAQ Calling as_map_destroy()

Detail

When using the Aerospike C client to work on map bins is it necessary to call as_map_destroy() explicitly when using as_operations_add_map_put_items() or when calling as_record_destroy()?

Answer

It is not necessary to call as_map_destroy() when using as_operations_add_map_put_items() as as_operations_add_map_put_items() takes ownership of aeroMap and calls as_map_destroy() after the map has been serialized. All CDT operations behave this way for dynamically allocated arguments (except ops, name and policy).

In the case of as_record_destroy(), this destroys all bins associated with the record in question and, as such, it is not necessarily to call as_map_destroy() explicitly.

Keywords

as_map_destroy as_record_destroy as_operations_add_map_put_items C Client CDT MAP

Timestamp

November 2019