Aerospike C client manual --- key-value storage-delete record, aerospike Client
Delete record
The API of the Aerospike C client provides a simple operation to delete data in the database.
Sample Code of data deletion is used by all samples. The following code references the sample directory examples/basic_examples/put, which is provided by the Aerospike C Client installation package.
Read the [create a connection] section to learn how to establish a connection with a cluster.
KEY)
When deleting a record, the database uses a key to identify the record. Next we will create a key for the sample code. The key is the string "test-key". The data namespace is named "test" and the set name is "test-set ".
As_key key; as_key_init_str (& key, "test", "test-set", "test-key ");
Delete record
You can use the previously initialized key to delete records in the database:
If (aerospike_key_remove (& as, & err, NULL, & key )! = AEROSPIKE_ OK) {fprintf (stderr, "err (% d) % s at [% s: % d] \ n", err. code, err. message, err. file, err. line );}
<Http://www.aerospike.com/docs/client/c/usage/kvs/delete.html>