Deleting Objects

The delete command follows a predictable pattern and looks like this:

DELETE /types/TYPE/buckets/BUCKET/keys/KEY

The normal HTTP response codes for DELETE operations are 204 No
Content and 404 Not Found. 404 responses are normal, in the sense
that DELETE operations are idempotent and not finding the resource has
the same effect as deleting it.

Let’s try to delete the genius key from the oscar_wilde bucket
(which bears the type quotes):

Client Library Examples

If you are updating an object that has been deleted—or if an update
might target a deleted object—we recommend that
you first fetch the causal context of the object prior to updating.
This can be done by setting the deletedvclock parameter to true as
part of the fetch operation. This can also be done
with the official Riak clients for Ruby, Java, and Erlang, as in the
example below: