Interface RJsonBucketReactive<V>

Type Parameters:
V - the type of object
All Superinterfaces:
RBucketReactive<V>, RExpirableReactive, RObjectReactive

public interface RJsonBucketReactive<V> extends RBucketReactive<V>
Redis JSON datatype holder. Data is stored as JSON object in Redis
Author:
Nikita Koksharov
  • Method Details

    • get

      <T> reactor.core.publisher.Mono<T> get(JsonCodec<T> codec, String... paths)
      Get Json object/objects by JSONPath
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      paths - JSON paths
      Returns:
      object
    • trySet

      reactor.core.publisher.Mono<Boolean> trySet(String path, Object value)
      Sets Json object by JSONPath only if previous value is empty
      Parameters:
      path - JSON path
      value - object
      Returns:
      true if successful, or false if value was already set
    • setIfExists

      reactor.core.publisher.Mono<Boolean> setIfExists(String path, Object value)
      Sets Json object by JSONPath only if previous value is non-empty
      Parameters:
      path - JSON path
      value - object
      Returns:
      true if successful, or false if element wasn't set
    • compareAndSet

      reactor.core.publisher.Mono<Boolean> compareAndSet(String path, Object expect, Object update)
      Atomically sets the value to the given updated value by given JSONPath, only if serialized state of the current value equals to serialized state of the expected value.
      Parameters:
      path - JSON path
      expect - the expected value
      update - the new value
      Returns:
      true if successful; or false if the actual value was not equal to the expected value.
    • getAndSet

      <T> reactor.core.publisher.Mono<T> getAndSet(JsonCodec<T> codec, String path, Object newValue)
      Retrieves current value of element specified by JSONPath and replaces it with newValue.
      Parameters:
      codec - object codec
      path - JSON path
      newValue - value to set
      Returns:
      previous value
    • set

      reactor.core.publisher.Mono<Void> set(String path, Object value)
      Stores object into element by specified JSONPath.
      Parameters:
      path - JSON path
      value - value to set
      Returns:
      void
    • stringSize

      reactor.core.publisher.Mono<Long> stringSize(String path)
      Returns size of string data by JSONPath
      Parameters:
      path - JSON path
      Returns:
      size of string
    • stringSizeMulti

      reactor.core.publisher.Mono<List<Long>> stringSizeMulti(String path)
      Returns list of string data size by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      Returns:
      list of string data sizes
    • stringAppend

      reactor.core.publisher.Mono<Long> stringAppend(String path, Object value)
      Appends string data to element specified by JSONPath. Returns new size of string data.
      Parameters:
      path - JSON path
      value - data
      Returns:
      size of string data
    • stringAppendMulti

      reactor.core.publisher.Mono<List<Long>> stringAppendMulti(String path, Object value)
      Appends string data to elements specified by JSONPath. Returns new size of string data. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      value - data
      Returns:
      list of string data sizes
    • arrayAppend

      reactor.core.publisher.Mono<Long> arrayAppend(String path, Object... values)
      Appends values to array specified by JSONPath. Returns new size of array.
      Parameters:
      path - JSON path
      values - values to append
      Returns:
      size of array
    • arrayAppendMulti

      reactor.core.publisher.Mono<List<Long>> arrayAppendMulti(String path, Object... values)
      Appends values to arrays specified by JSONPath. Returns new size of arrays. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      values - values to append
      Returns:
      list of arrays size
    • arrayIndex

      reactor.core.publisher.Mono<Long> arrayIndex(String path, Object value)
      Returns index of object in array specified by JSONPath. -1 means object not found.
      Parameters:
      path - JSON path
      value - value to search
      Returns:
      index in array
    • arrayIndexMulti

      reactor.core.publisher.Mono<List<Long>> arrayIndexMulti(String path, Object value)
      Returns index of object in arrays specified by JSONPath. -1 means object not found. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      value - value to search
      Returns:
      list of index in arrays
    • arrayIndex

      reactor.core.publisher.Mono<Long> arrayIndex(String path, Object value, reactor.core.publisher.Mono<Long> start, reactor.core.publisher.Mono<Long> end)
      Returns index of object in array specified by JSONPath in range between start (inclusive) and end (exclusive) indexes. -1 means object not found.
      Parameters:
      path - JSON path
      value - value to search
      start - start index, inclusive
      end - end index, exclusive
      Returns:
      index in array
    • arrayIndexMulti

      reactor.core.publisher.Mono<List<Long>> arrayIndexMulti(String path, Object value, reactor.core.publisher.Mono<Long> start, reactor.core.publisher.Mono<Long> end)
      Returns index of object in arrays specified by JSONPath in range between start (inclusive) and end (exclusive) indexes. -1 means object not found. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      value - value to search
      start - start index, inclusive
      end - end index, exclusive
      Returns:
      list of index in arrays
    • arrayInsert

      reactor.core.publisher.Mono<Long> arrayInsert(String path, reactor.core.publisher.Mono<Long> index, Object... values)
      Inserts values into array specified by JSONPath. Values are inserted at defined index.
      Parameters:
      path - JSON path
      index - array index at which values are inserted
      values - values to insert
      Returns:
      size of array
    • arrayInsertMulti

      reactor.core.publisher.Mono<List<Long>> arrayInsertMulti(String path, reactor.core.publisher.Mono<Long> index, Object... values)
      Inserts values into arrays specified by JSONPath. Values are inserted at defined index. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      index - array index at which values are inserted
      values - values to insert
      Returns:
      list of arrays size
    • arraySize

      reactor.core.publisher.Mono<Long> arraySize(String path)
      Returns size of array specified by JSONPath.
      Parameters:
      path - JSON path
      Returns:
      size of array
    • arraySizeMulti

      reactor.core.publisher.Mono<List<Long>> arraySizeMulti(String path)
      Returns size of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      Returns:
      list of arrays size
    • arrayPollLast

      <T> reactor.core.publisher.Mono<T> arrayPollLast(JsonCodec<T> codec, String path)
      Polls last element of array specified by JSONPath.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      last element
    • arrayPollLastMulti

      <T> reactor.core.publisher.Mono<List<T>> arrayPollLastMulti(JsonCodec<T> codec, String path)
      Polls last element of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      list of last elements
    • arrayPollFirst

      <T> reactor.core.publisher.Mono<T> arrayPollFirst(JsonCodec<T> codec, String path)
      Polls first element of array specified by JSONPath.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      first element
    • arrayPollFirstMulti

      <T> reactor.core.publisher.Mono<List<T>> arrayPollFirstMulti(JsonCodec<T> codec, String path)
      Polls first element of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      Returns:
      list of first elements
    • arrayPop

      <T> reactor.core.publisher.Mono<T> arrayPop(JsonCodec<T> codec, String path, reactor.core.publisher.Mono<Long> index)
      Pops element located at index of array specified by JSONPath.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      index - array index
      Returns:
      element
    • arrayPopMulti

      <T> reactor.core.publisher.Mono<List<T>> arrayPopMulti(JsonCodec<T> codec, String path, reactor.core.publisher.Mono<Long> index)
      Pops elements located at index of arrays specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Type Parameters:
      T - the type of object
      Parameters:
      codec - object codec
      path - JSON path
      index - array index
      Returns:
      list of elements
    • arrayTrim

      reactor.core.publisher.Mono<Long> arrayTrim(String path, reactor.core.publisher.Mono<Long> start, reactor.core.publisher.Mono<Long> end)
      Trims array specified by JSONPath in range between start (inclusive) and end (inclusive) indexes.
      Parameters:
      path - JSON path
      start - start index, inclusive
      end - end index, inclusive
      Returns:
      length of array
    • arrayTrimMulti

      reactor.core.publisher.Mono<List<Long>> arrayTrimMulti(String path, reactor.core.publisher.Mono<Long> start, reactor.core.publisher.Mono<Long> end)
      Trims arrays specified by JSONPath in range between start (inclusive) and end (inclusive) indexes. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      start - start index, inclusive
      end - end index, inclusive
      Returns:
      length of array
    • clear

      reactor.core.publisher.Mono<Long> clear()
      Clears json container.
      Returns:
      number of cleared containers
    • clear

      reactor.core.publisher.Mono<Long> clear(String path)
      Clears json container specified by JSONPath. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      Returns:
      number of cleared containers
    • incrementAndGet

      <T extends Number> reactor.core.publisher.Mono<T> incrementAndGet(String path, reactor.core.publisher.Mono<T> delta)
      Increments the current value specified by JSONPath by delta.
      Parameters:
      path - JSON path
      delta - increment value
      Returns:
      the updated value
    • incrementAndGetMulti

      <T extends Number> reactor.core.publisher.Mono<List<T>> incrementAndGetMulti(String path, reactor.core.publisher.Mono<T> delta)
      Increments the current values specified by JSONPath by delta. Compatible only with enhanced syntax starting with '$' character.
      Parameters:
      path - JSON path
      delta - increment value
      Returns:
      list of updated value
    • countKeys

      reactor.core.publisher.Mono<Long> countKeys()
      Returns keys amount in JSON container
      Returns:
      keys amount
    • countKeys

      reactor.core.publisher.Mono<Long> countKeys(String path)
      Returns keys amount in JSON container specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      keys amount
    • countKeysMulti

      reactor.core.publisher.Mono<List<Long>> countKeysMulti(String path)
      Returns list of keys amount in JSON containers specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of keys amount
    • getKeys

      reactor.core.publisher.Mono<List<String>> getKeys()
      Returns list of keys in JSON container
      Returns:
      list of keys
    • getKeys

      reactor.core.publisher.Mono<List<String>> getKeys(String path)
      Returns list of keys in JSON container specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of keys
    • getKeysMulti

      reactor.core.publisher.Mono<List<List<String>>> getKeysMulti(String path)
      Returns list of keys in JSON containers specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of keys
    • toggle

      reactor.core.publisher.Mono<Boolean> toggle(String path)
      Toggle Mono value specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      new Mono value
    • toggleMulti

      reactor.core.publisher.Mono<List<Boolean>> toggleMulti(String path)
      Toggle Mono values specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      list of Mono values
    • getType

      reactor.core.publisher.Mono<JsonType> getType()
      Returns type of element
      Returns:
      type of element
    • getType

      reactor.core.publisher.Mono<JsonType> getType(String path)
      Returns type of element specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      type of element
    • delete

      reactor.core.publisher.Mono<Long> delete(String path)
      Deletes JSON elements specified by JSONPath
      Parameters:
      path - JSON path
      Returns:
      number of deleted elements