Skip to content
Visit booth 3171 at Google Cloud Next to see how to unlock real-time decisions at scaleMore info

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);
}
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?