kv_multi_delete()

#include <kvstore.h>

kv_int_t 
kv_multi_delete(kv_store_t *store, const kv_key_t *parent_key,
                const kv_key_range_t *key_range,kv_depth_enum depth, kv_durability_t durability,
                kv_timeout_t timeout_ms) 

Deletes the descendent key/value pairs associated with the parent_key. Returns the total number of keys deleted. If an error, returns an integer value less than zero.

All of the deletions performed as a result of this operation are performed within the context of a single transaction. This means that either all matching key/value pairs are deleted, or none of them are.

Parameters

  • store

    The store parameter is the handle to the store in which you want to perform the delete operation.

  • parent_key

    The parent_key parameter is the parent key whose "child" records are to be deleted. It must not be NULL. The major key path must be complete. The minor key path may be omitted or may be a partial path.

    You construct a key using kv_create_key().

  • key_range

    The key_range parameter further restricts the range under the parent_key to the minor path components in this key range. It may be NULL.

    You construct a key range using kv_init_key_range().

  • depth

    The depth parameter specifies how deep the deletion can go. You can allow only children to be deleted, the parent and all the children, all descendants, and so forth. See kv_depth_enum for a description of all your depth options.

  • durability

    The durability parameter identifies the durability to be used for this write 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().