FAQ Calling as_map_destroy

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

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.