kv_result_get_previous_value()

#include <kvstore.h>

kv_error_t 
kv_result_get_previous_value(const kv_operation_results_t *res,
                             kv_int_t index,
                             const kv_value_t **value) 

Returns the previous value that existed before a put operation was run as a part of multi-step, sequence of operations. A previous value will only exist if the provided index in the operation contains a put operation as created by kv_create_put_with_options_op(), and if that function's return_info parameter is KV_RETURN_VALUE_ALL or KV_RETURN_VALUE_VALUE.

If the index parameter is out of range, this function returns KV_NO_SUCH_OBJECT.

Parameters

  • res

    The res parameter is the operation results list that contains the previous value you want to examine.

  • index

    The index parameter is the index in the results list which holds the information you want to retrieve.

  • value

    The value parameter references memory to which is copied the previous value. Release the resources used by this value using kv_release_value().

    This parameter will be NULL if the indexed result was not generated by put operation that was configured to return previous values.