Deleting Records - aerospike-community/aerospike-client-php GitHub Wiki
Deleting Records
Use these Aerospike PHP client methods to delete record and bin data from the Aerospike database:
-
remove()
— Remove the record at the specified key. -
removeBin()
— Remove specified bins from a record.- Remove one bin from a record:
$key = $db->initKey("infosphere", "characters", 3); $db->removeBin($key, ["Alma Mater"]);
- Remove a record completely:
```php
$key = $db->initKey("infosphere", "characters", 5);
$status = $db->remove($key);
if ($status == Aerospike::OK) {
echo "Record removed.\n";
} elseif ($status == Aerospike::ERR_RECORD_NOT_FOUND) {
echo "No such record in the database.\n";
} else {
echo "Error [{$db->errorno()}]: ".$db->error();
}