Delete a single row from a Tablestore data table by specifying the table name and the primary key of the row.
Before you begin
Method
public function deleteRow(array $request)
Example
Delete the row whose primary key value is row1 from the test_table table:
try{
$response = $client->deleteRow(array (
'table_name' => 'test_table',
'primary_key' => array (
array ('id', 'row1')
),
// A condition is required to delete a row. RowExistenceExpectationConst::CONST_IGNORE specifies that the existence of the row is not checked.
'condition' => RowExistenceExpectationConst::CONST_IGNORE
));
echo "Read CU Cost: " . $response['consumed']['capacity_unit']['read'] . "\n";
echo "Write CU Cost: " . $response['consumed']['capacity_unit']['write'] . "\n";
} catch (Exception $e) {
echo "Delete Row failed.";
}