---
title: "Delete"
description: "Learn how to delete records in Aerospike using the Rust client with practical code examples and error handling."
---

# Delete

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

This example deletes the key `mykey` from the namespace `test` in the set `myset`:

```rust
let key = as_key!("test", "test", "mykey");

match client.delete(&WritePolicy::default(), &key).await {

    Ok(true) => println!("Record deleted"),

    Ok(false) => println!("Record did not exist"),

    Err(err) => println!("Error deleting record: {}", err),

};
```

> 📖 **API reference**: [`Client::delete`](https://docs.rs/aerospike/latest/aerospike/struct.Client.html#method.delete) | [`WritePolicy::default`](https://docs.rs/aerospike/latest/aerospike/struct.WritePolicy.html)