The delete() method deletes an item in
the database with the specified key. Delete operations are
asynchronous only.
| API Call | client.delete(key) | ||
| Asynchronous | yes | ||
| Description | Delete a key/value | ||
| Returns | OperationFuture<Boolean> (
Asynchronous request value, as Boolean
) | ||
| Arguments | |||
String key | Document ID used to identify the value | ||
For example, to delete an item you might use code similar to the following:
OperationFuture<Boolean> delOp = client.delete("samplekey"); try { if (delOp.get().booleanValue()) { System.out.printf("Delete succeeded\n"); } else { System.out.printf("Delete failed\n"); } } catch (Exception e) { System.out.println("Failed to delete " + e); }