Interface ZSetOperations<K,V>


public interface ZSetOperations<K,V>
Redis ZSet/sorted set specific operations.
Author:
Costin Leau, Christoph Strobl, Mark Paluch, Rosty Kerei, Wongoo (望哥), Andrey Shlykov, Shyngys Sapraliyev
  • Method Details

    • add

      @Nullable Boolean add(K key, V value, double score)
      Add value to a sorted set at key, or update its score if it already exists.
      Parameters:
      key - must not be null.
      value - the value.
      score - the score.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • addIfAbsent

      @Nullable Boolean addIfAbsent(K key, V value, double score)
      Add value to a sorted set at key if it does not already exists.
      Parameters:
      key - must not be null.
      value - the value.
      score - the score.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.5
      See Also:
    • add

      Add tuples to a sorted set at key, or update its score if it already exists.
      Parameters:
      key - must not be null.
      tuples - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • addIfAbsent

      @Nullable Long addIfAbsent(K key, Set<ZSetOperations.TypedTuple<V>> tuples)
      Add tuples to a sorted set at key if it does not already exists.
      Parameters:
      key - must not be null.
      tuples - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.5
      See Also:
    • remove

      @Nullable Long remove(K key, Object... values)
      Remove values from sorted set. Return number of removed elements.
      Parameters:
      key - must not be null.
      values - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • incrementScore

      @Nullable Double incrementScore(K key, V value, double delta)
      Increment the score of element with value in sorted set by increment.
      Parameters:
      key - must not be null.
      value - the value.
      delta - the delta to add. Can be negative.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • randomMember

      V randomMember(K key)
      Get random element from set at key.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • distinctRandomMembers

      @Nullable Set<V> distinctRandomMembers(K key, long count)
      Get count distinct random elements from set at key.
      Parameters:
      key - must not be null.
      count - number of members to return.
      Returns:
      empty Set if key does not exist.
      Throws:
      IllegalArgumentException - if count is negative.
      Since:
      2.6
      See Also:
    • randomMembers

      @Nullable List<V> randomMembers(K key, long count)
      Get count random elements from set at key.
      Parameters:
      key - must not be null.
      count - number of members to return.
      Returns:
      empty List if key does not exist or null when used in pipeline / transaction.
      Throws:
      IllegalArgumentException - if count is negative.
      Since:
      2.6
      See Also:
    • randomMemberWithScore

      ZSetOperations.TypedTuple<V> randomMemberWithScore(K key)
      Get random element with its score from set at key.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • distinctRandomMembersWithScore

      @Nullable Set<ZSetOperations.TypedTuple<V>> distinctRandomMembersWithScore(K key, long count)
      Get count distinct random elements with their score from set at key.
      Parameters:
      key - must not be null.
      count - number of members to return.
      Returns:
      empty Set if key does not exist.
      Throws:
      IllegalArgumentException - if count is negative.
      Since:
      2.6
      See Also:
    • randomMembersWithScore

      @Nullable List<ZSetOperations.TypedTuple<V>> randomMembersWithScore(K key, long count)
      Get count random elements with their score from set at key.
      Parameters:
      key - must not be null.
      count - number of members to return.
      Returns:
      empty List if key does not exist or null when used in pipeline / transaction.
      Throws:
      IllegalArgumentException - if count is negative.
      Since:
      2.6
      See Also:
    • rank

      @Nullable Long rank(K key, Object o)
      Determine the index of element with value in a sorted set.
      Parameters:
      key - must not be null.
      o - the value.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • reverseRank

      @Nullable Long reverseRank(K key, Object o)
      Determine the index of element with value in a sorted set when scored high to low.
      Parameters:
      key - must not be null.
      o - the value.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • range

      @Nullable Set<V> range(K key, long start, long end)
      Get elements between start and end from sorted set.
      Parameters:
      key - must not be null.
      start -
      end -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • rangeWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> rangeWithScores(K key, long start, long end)
      Get set of Tuples between start and end from sorted set.
      Parameters:
      key - must not be null.
      start -
      end -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • rangeByScore

      @Nullable Set<V> rangeByScore(K key, double min, double max)
      Get elements where score is between min and max from sorted set.
      Parameters:
      key - must not be null.
      min -
      max -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • rangeByScoreWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> rangeByScoreWithScores(K key, double min, double max)
      Get set of Tuples where score is between min and max from sorted set.
      Parameters:
      key - must not be null.
      min -
      max -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • rangeByScore

      @Nullable Set<V> rangeByScore(K key, double min, double max, long offset, long count)
      Get elements in range from start to end where score is between min and max from sorted set.
      Parameters:
      key - must not be null.
      min -
      max -
      offset -
      count -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • rangeByScoreWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> rangeByScoreWithScores(K key, double min, double max, long offset, long count)
      Get set of Tuples in range from start to end where score is between min and max from sorted set.
      Parameters:
      key -
      min -
      max -
      offset -
      count -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • reverseRange

      @Nullable Set<V> reverseRange(K key, long start, long end)
      Get elements in range from start to end from sorted set ordered from high to low.
      Parameters:
      key - must not be null.
      start -
      end -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • reverseRangeWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> reverseRangeWithScores(K key, long start, long end)
      Get set of Tuples in range from start to end from sorted set ordered from high to low.
      Parameters:
      key - must not be null.
      start -
      end -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • reverseRangeByScore

      @Nullable Set<V> reverseRangeByScore(K key, double min, double max)
      Get elements where score is between min and max from sorted set ordered from high to low.
      Parameters:
      key - must not be null.
      min -
      max -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • reverseRangeByScoreWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> reverseRangeByScoreWithScores(K key, double min, double max)
      Get set of Tuple where score is between min and max from sorted set ordered from high to low.
      Parameters:
      key - must not be null.
      min -
      max -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • reverseRangeByScore

      @Nullable Set<V> reverseRangeByScore(K key, double min, double max, long offset, long count)
      Get elements in range from start to end where score is between min and max from sorted set ordered high -> low.
      Parameters:
      key - must not be null.
      min -
      max -
      offset -
      count -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • reverseRangeByScoreWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> reverseRangeByScoreWithScores(K key, double min, double max, long offset, long count)
      Get set of Tuple in range from start to end where score is between min and max from sorted set ordered high -> low.
      Parameters:
      key - must not be null.
      min -
      max -
      offset -
      count -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • count

      @Nullable Long count(K key, double min, double max)
      Count number of elements within sorted set with scores between min and max.
      Parameters:
      key - must not be null.
      min -
      max -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • lexCount

      @Nullable @Deprecated(since="3.0", forRemoval=true) default Long lexCount(K key, RedisZSetCommands.Range range)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.0. Please use #lexCount(Range) instead.
      Count number of elements within sorted set with value between Range.getLowerBound() and Range.getUpperBound() applying lexicographical ordering.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.4
      See Also:
    • lexCount

      @Nullable Long lexCount(K key, org.springframework.data.domain.Range<String> range)
      Count number of elements within sorted set with value between Range.getLowerBound() and Range.getUpperBound() applying lexicographical ordering.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • popMin

      Remove and return the value with its score having the lowest score from sorted set at key.
      Parameters:
      key - must not be null.
      Returns:
      null when the sorted set is empty or used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • popMin

      @Nullable Set<ZSetOperations.TypedTuple<V>> popMin(K key, long count)
      Remove and return count values with their score having the lowest score from sorted set at key.
      Parameters:
      key - must not be null.
      count - number of elements to pop.
      Returns:
      null when the sorted set is empty or used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • popMin

      @Nullable ZSetOperations.TypedTuple<V> popMin(K key, long timeout, TimeUnit unit)
      Remove and return the value with its score having the lowest score from sorted set at key.
      Blocks connection until element available or timeout reached.
      Parameters:
      key - must not be null.
      timeout -
      unit - must not be null.
      Returns:
      can be null.
      Since:
      2.6
      See Also:
    • popMin

      @Nullable default ZSetOperations.TypedTuple<V> popMin(K key, Duration timeout)
      Remove and return the value with its score having the lowest score from sorted set at key.
      Blocks connection until element available or timeout reached.
      Parameters:
      key - must not be null.
      timeout - must not be null.
      Returns:
      can be null.
      Throws:
      IllegalArgumentException - if the timeout is null or negative.
      Since:
      2.6
      See Also:
    • popMax

      Remove and return the value with its score having the highest score from sorted set at key.
      Parameters:
      key - must not be null.
      Returns:
      null when the sorted set is empty or used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • popMax

      @Nullable Set<ZSetOperations.TypedTuple<V>> popMax(K key, long count)
      Remove and return count values with their score having the highest score from sorted set at key.
      Parameters:
      key - must not be null.
      count - number of elements to pop.
      Returns:
      null when the sorted set is empty or used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • popMax

      @Nullable ZSetOperations.TypedTuple<V> popMax(K key, long timeout, TimeUnit unit)
      Remove and return the value with its score having the highest score from sorted set at key.
      Blocks connection until element available or timeout reached.
      Parameters:
      key - must not be null.
      timeout -
      unit - must not be null.
      Returns:
      can be null.
      Since:
      2.6
      See Also:
    • popMax

      @Nullable default ZSetOperations.TypedTuple<V> popMax(K key, Duration timeout)
      Remove and return the value with its score having the highest score from sorted set at key.
      Blocks connection until element available or timeout reached.
      Parameters:
      key - must not be null.
      timeout - must not be null.
      Returns:
      can be null.
      Throws:
      IllegalArgumentException - if the timeout is null or negative.
      Since:
      2.6
      See Also:
    • size

      @Nullable Long size(K key)
      Returns the number of elements of the sorted set stored with given key.
      Parameters:
      key -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zCard

      @Nullable Long zCard(K key)
      Get the size of sorted set with key.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.3
      See Also:
    • score

      @Nullable Double score(K key, Object o)
      Get the score of element with value from sorted set with key key.
      Parameters:
      key - must not be null.
      o - the value.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • score

      @Nullable List<Double> score(K key, Object... o)
      Get the scores of elements with values from sorted set with key key.
      Parameters:
      key - must not be null.
      o - the values.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • removeRange

      @Nullable Long removeRange(K key, long start, long end)
      Remove elements in range between start and end from sorted set with key.
      Parameters:
      key - must not be null.
      start -
      end -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • removeRangeByLex

      @Nullable @Deprecated(since="3.0", forRemoval=true) default Long removeRangeByLex(K key, RedisZSetCommands.Range range)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.0. Please use removeRangeByLex(Object, Range) instead;
      Remove elements in Range from sorted set with key.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.5
      See Also:
    • removeRangeByLex

      @Nullable Long removeRangeByLex(K key, org.springframework.data.domain.Range<String> range)
      Remove elements in Range from sorted set with key.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • removeRangeByScore

      @Nullable Long removeRangeByScore(K key, double min, double max)
      Remove elements with scores between min and max from sorted set with key.
      Parameters:
      key - must not be null.
      min -
      max -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • difference

      @Nullable default Set<V> difference(K key, K otherKey)
      Diff sorted sets.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • difference

      @Nullable Set<V> difference(K key, Collection<K> otherKeys)
      Diff sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • differenceWithScores

      @Nullable default Set<ZSetOperations.TypedTuple<V>> differenceWithScores(K key, K otherKey)
      Diff sorted sets.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • differenceWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> differenceWithScores(K key, Collection<K> otherKeys)
      Diff sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • differenceAndStore

      @Nullable Long differenceAndStore(K key, Collection<K> otherKeys, K destKey)
      Diff sorted sets and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      destKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • intersect

      @Nullable default Set<V> intersect(K key, K otherKey)
      Intersect sorted sets.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • intersect

      @Nullable Set<V> intersect(K key, Collection<K> otherKeys)
      Intersect sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • intersectWithScores

      @Nullable default Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, K otherKey)
      Intersect sorted sets.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • intersectWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, Collection<K> otherKeys)
      Intersect sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • intersectWithScores

      @Nullable default Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, Collection<K> otherKeys, Aggregate aggregate)
      Intersect sorted sets at key and otherKeys .
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      aggregate - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • intersectWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, Collection<K> otherKeys, Aggregate aggregate, Weights weights)
      Intersect sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      Returns:
      Since:
      2.6
      See Also:
    • intersectAndStore

      @Nullable Long intersectAndStore(K key, K otherKey, K destKey)
      Intersect sorted sets at key and otherKey and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      destKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • intersectAndStore

      @Nullable Long intersectAndStore(K key, Collection<K> otherKeys, K destKey)
      Intersect sorted sets at key and otherKeys and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      destKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • intersectAndStore

      @Nullable default Long intersectAndStore(K key, Collection<K> otherKeys, K destKey, Aggregate aggregate)
      Intersect sorted sets at key and otherKeys and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      destKey - must not be null.
      aggregate - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.1
      See Also:
    • intersectAndStore

      @Nullable Long intersectAndStore(K key, Collection<K> otherKeys, K destKey, Aggregate aggregate, Weights weights)
      Intersect sorted sets at key and otherKeys and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      destKey - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.1
      See Also:
    • union

      @Nullable default Set<V> union(K key, K otherKey)
      Union sorted sets.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • union

      @Nullable Set<V> union(K key, Collection<K> otherKeys)
      Union sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • unionWithScores

      @Nullable default Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, K otherKey)
      Union sorted sets.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • unionWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, Collection<K> otherKeys)
      Union sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • unionWithScores

      @Nullable default Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, Collection<K> otherKeys, Aggregate aggregate)
      Union sorted sets at key and otherKeys .
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      aggregate - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • unionWithScores

      @Nullable Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, Collection<K> otherKeys, Aggregate aggregate, Weights weights)
      Union sorted sets.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • unionAndStore

      @Nullable Long unionAndStore(K key, K otherKey, K destKey)
      Union sorted sets at key and otherKeys and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKey - must not be null.
      destKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • unionAndStore

      @Nullable Long unionAndStore(K key, Collection<K> otherKeys, K destKey)
      Union sorted sets at key and otherKeys and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      destKey - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • unionAndStore

      @Nullable default Long unionAndStore(K key, Collection<K> otherKeys, K destKey, Aggregate aggregate)
      Union sorted sets at key and otherKeys and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      destKey - must not be null.
      aggregate - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.1
      See Also:
    • unionAndStore

      @Nullable Long unionAndStore(K key, Collection<K> otherKeys, K destKey, Aggregate aggregate, Weights weights)
      Union sorted sets at key and otherKeys and store result in destination destKey.
      Parameters:
      key - must not be null.
      otherKeys - must not be null.
      destKey - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.1
      See Also:
    • scan

      Use a Cursor to iterate over entries zset at key.
      Important: Call CloseableIterator.close() when done to avoid resource leaks.
      Parameters:
      key -
      options - must not be null.
      Returns:
      the result cursor providing access to the scan result. Must be closed once fully processed (e.g. through a try-with-resources clause).
      Since:
      1.4
      See Also:
    • rangeByLex

      @Nullable @Deprecated(since="3.0", forRemoval=true) default Set<V> rangeByLex(K key, RedisZSetCommands.Range range)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.0. Please use rangeByLex(Object, Range) instead.
      Get all elements with lexicographical ordering from ZSET at key with a value between RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.7
      See Also:
    • rangeByLex

      @Nullable default Set<V> rangeByLex(K key, org.springframework.data.domain.Range<String> range)
      Get all elements with lexicographical ordering from ZSET at key with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • rangeByLex

      @Nullable @Deprecated(since="3.0", forRemoval=true) default Set<V> rangeByLex(K key, RedisZSetCommands.Range range, Limit limit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.0. Please use rangeByLex(Object, Range, Limit) instead.
      Get all elements n elements, where n = Limit.getCount(), starting at Limit.getOffset() with lexicographical ordering from ZSET at key with a value between RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().
      Parameters:
      key - must not be null
      range - must not be null.
      limit - can be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.7
      See Also:
    • rangeByLex

      @Nullable Set<V> rangeByLex(K key, org.springframework.data.domain.Range<String> range, Limit limit)
      Get all elements n elements, where n = Limit.getCount(), starting at Limit.getOffset() with lexicographical ordering from ZSET at key with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      key - must not be null
      range - must not be null.
      limit - can be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • reverseRangeByLex

      @Nullable @Deprecated(since="3.0", forRemoval=true) default Set<V> reverseRangeByLex(K key, RedisZSetCommands.Range range)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.0. Please use reverseRangeByLex(Object, Range)
      Get all elements with reverse lexicographical ordering from ZSET at key with a value between RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.4
      See Also:
    • reverseRangeByLex

      @Nullable default Set<V> reverseRangeByLex(K key, org.springframework.data.domain.Range<String> range)
      Get all elements with reverse lexicographical ordering from ZSET at key with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • reverseRangeByLex

      @Nullable @Deprecated(since="3.0", forRemoval=true) default Set<V> reverseRangeByLex(K key, RedisZSetCommands.Range range, Limit limit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.0. Please use reverseRangeByLex(Object, Range, Limit) instead.
      Get all elements n elements, where n = Limit.getCount(), starting at Limit.getOffset() with reverse lexicographical ordering from ZSET at key with a value between RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - can be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.4
      See Also:
    • reverseRangeByLex

      @Nullable Set<V> reverseRangeByLex(K key, org.springframework.data.domain.Range<String> range, Limit limit)
      Get all elements n elements, where n = Limit.getCount(), starting at Limit.getOffset() with reverse lexicographical ordering from ZSET at key with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - can be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.4
      See Also:
    • rangeAndStoreByLex

      @Nullable default Long rangeAndStoreByLex(K srcKey, K dstKey, org.springframework.data.domain.Range<String> range)
      Store all elements at dstKey with lexicographical ordering from ZSET at srcKey with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • rangeAndStoreByLex

      @Nullable Long rangeAndStoreByLex(K srcKey, K dstKey, org.springframework.data.domain.Range<String> range, Limit limit)
      Store n elements at dstKey, where n = Limit.getCount(), starting at Limit.getOffset() with lexicographical ordering from ZSET at srcKey with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • reverseRangeAndStoreByLex

      @Nullable default Long reverseRangeAndStoreByLex(K srcKey, K dstKey, org.springframework.data.domain.Range<String> range)
      Store all elements at dstKey with reverse lexicographical ordering from ZSET at srcKey with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • reverseRangeAndStoreByLex

      @Nullable Long reverseRangeAndStoreByLex(K srcKey, K dstKey, org.springframework.data.domain.Range<String> range, Limit limit)
      Store n elements at dstKey, where n = Limit.getCount(), starting at Limit.getOffset() with reverse lexicographical ordering from ZSET at srcKey with a value between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • rangeAndStoreByScore

      @Nullable default Long rangeAndStoreByScore(K srcKey, K dstKey, org.springframework.data.domain.Range<? extends Number> range)
      Store all elements at dstKey with ordering by score from ZSET at srcKey with a score between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • rangeAndStoreByScore

      @Nullable Long rangeAndStoreByScore(K srcKey, K dstKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit)
      Store n elements at dstKey, where n = Limit.getCount(), starting at Limit.getOffset() with ordering by score from ZSET at srcKey with a score between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • reverseRangeAndStoreByScore

      @Nullable default Long reverseRangeAndStoreByScore(K srcKey, K dstKey, org.springframework.data.domain.Range<? extends Number> range)
      Store all elements at dstKey with reverse ordering by score from ZSET at srcKey with a score between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • reverseRangeAndStoreByScore

      @Nullable Long reverseRangeAndStoreByScore(K srcKey, K dstKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit)
      Store n elements at dstKey, where n = Limit.getCount(), starting at Limit.getOffset() with reverse ordering by score from ZSET at srcKey with a score between Range.getLowerBound() and Range.getUpperBound().
      Parameters:
      srcKey - must not be null.
      dstKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      the number of stored elements or null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • getOperations

      RedisOperations<K,V> getOperations()
      Returns:
      never null.