kv_delete_with_options()
#include <kvstore.h>
kv_error_tkv_delete_with_options(kv_store_t *store,
const kv_key_t *key,
const kv_version_t *if_version,
kv_value_t **previous_value,kv_return_value_version_enum return_info,
kv_durability_t durability,
kv_timeout_t timeout_ms)
Delete the key/value pair associated with the key.
Deleting a key/value pair with this method does not automatically delete its children or descendant key/value pairs. To delete children or descendants, use kv_multi_delete() instead.
Possible outcomes when calling this method are:
-
The KV pair was deleted and the number of records deleted is returned. For this function, a successful return value will always be
0
or1.
-
The KV pair was not guaranteed to be deleted successfully. A non-success kv_error_t error is returned; that is, a negative integer is returned.
Parameters
-
store
The store parameter is the handle to the store in which you want to perform the delete operation.
-
key
The key parameter is the key used to look up the key/value pair to be deleted.
-
if_version
The if_version parameter indicates the Version that the record must match before it can be deleted. The Version is obtained using the kv_get_version() function.
-
previous_value
The previous_value parameter references memory into which is copied the Value portion of the Key/Value pair that this function deleted.
-
return_info
The return_info parameter indicates what information should be returned to the kv_execute() results list by this operation. See kv_return_value_version_enum for a description of the options accepted by this parameter.
-
durability
The durability parameter provides the durability guarantee to be used with this delete operation. Durability guarantees are created using kv_create_durability().
-
timeout_ms
The timeout_ms parameter provides an upper bound on the time interval for processing the operation. A best effort is made not to exceed the specified limit. If zero, the default request timeout is used. The default request timeout is set using kv_config_set_timeouts().