Delete
Use aerospike_key_remove()
to delete data from the database.
These examples are in examples/basic_examples/put in the Aerospike C client package.
The client must have an established the cluster connection.
Initializing the Key
The application identifies records in the database using a key. In this example, the value for key is the string test-key, to delete from namespace test within the set test-set.
as_key key;as_key_init_str(&key, "test", "test-set", "test-key");
Deleting Records
To delete the record from 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);}