Interface RedisZSetCommands

All Known Subinterfaces:
DefaultedRedisClusterConnection, DefaultedRedisConnection, RedisClusterConnection, RedisCommands, RedisConnection, RedisConnectionUtils.RedisConnectionProxy, StringRedisConnection
All Known Implementing Classes:
AbstractRedisConnection, DefaultStringRedisConnection, JedisClusterConnection, JedisConnection, LettuceClusterConnection, LettuceConnection

public interface RedisZSetCommands
ZSet(SortedSet)-specific commands supported by Redis.
Author:
Costin Leau, Christoph Strobl, Thomas Darimont, David Liu, Mark Paluch, Andrey Shlykov, Shyngys Sapraliyev
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Deprecated.
    since 3.0, use Limit instead.
    static class 
    Deprecated.
    since 3.0, use Range or RedisZSetCommands.Range.toRange() instead.
    static class 
    ZADD specific arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    bZPopMax(byte[] key, long timeout, TimeUnit unit)
    Remove and return the value with its score having the highest score from sorted set at key.
    bZPopMin(byte[] key, long timeout, TimeUnit unit)
    Remove and return the value with its score having the lowest score from sorted set at key.
    default Boolean
    zAdd(byte[] key, double score, byte[] value)
    Add value to a sorted set at key, or update its score if it already exists.
    zAdd(byte[] key, double score, byte[] value, RedisZSetCommands.ZAddArgs args)
    Add value to a sorted set at key, or update its score depending on the given args.
    default Long
    zAdd(byte[] key, Set<Tuple> tuples)
    Add tuples to a sorted set at key, or update its score if it already exists.
    zAdd(byte[] key, Set<Tuple> tuples, RedisZSetCommands.ZAddArgs args)
    Add tuples to a sorted set at key, or update its score depending on the given args.
    zCard(byte[] key)
    Get the size of sorted set with key.
    default Long
    zCount(byte[] key, double min, double max)
    Count number of elements within sorted set with scores between min and max.
    zCount(byte[] key, Range<? extends Number> range)
    Count number of elements within sorted set with scores between Range#min and Range#max.
    Set<byte[]>
    zDiff(byte[]... sets)
    Diff sorted sets.
    zDiffStore(byte[] destKey, byte[]... sets)
    Diff sorted sets and store result in destination destKey.
    zDiffWithScores(byte[]... sets)
    Diff sorted sets.
    zIncrBy(byte[] key, double increment, byte[] value)
    Increment the score of element with value in sorted set by increment.
    Set<byte[]>
    zInter(byte[]... sets)
    Intersect sorted sets.
    zInterStore(byte[] destKey, byte[]... sets)
    Intersect sorted sets and store result in destination destKey.
    default Long
    zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets)
    Intersect sorted sets and store result in destination destKey.
    zInterStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets)
    Intersect sorted sets and store result in destination destKey.
    zInterWithScores(byte[]... sets)
    Intersect sorted sets.
    default Set<Tuple>
    zInterWithScores(Aggregate aggregate, int[] weights, byte[]... sets)
    Intersect sorted sets.
    zInterWithScores(Aggregate aggregate, Weights weights, byte[]... sets)
    Intersect sorted sets.
    zLexCount(byte[] key, Range<byte[]> range)
    Count number of elements within sorted set with value between Range#min and Range#max applying lexicographical ordering.
    zMScore(byte[] key, byte[]... values)
    Get the scores of elements with values from sorted set with key key.
    zPopMax(byte[] key)
    Remove and return the value with its score having the highest score from sorted set at key.
    zPopMax(byte[] key, long count)
    Remove and return count values with their score having the highest score from sorted set at key.
    zPopMin(byte[] key)
    Remove and return the value with its score having the lowest score from sorted set at key.
    zPopMin(byte[] key, long count)
    Remove and return count values with their score having the lowest score from sorted set at key.
    byte[]
    zRandMember(byte[] key)
    Get random element from sorted set at key.
    List<byte[]>
    zRandMember(byte[] key, long count)
    Get count random elements from sorted set at key.
    Get random element from sorted set at key.
    zRandMemberWithScore(byte[] key, long count)
    Get count random elements from sorted set at key.
    Set<byte[]>
    zRange(byte[] key, long start, long end)
    Get elements between start and end from sorted set.
    default Set<byte[]>
    zRangeByLex(byte[] key)
    Get all the elements in the sorted set at key in lexicographical ordering.
    default Set<byte[]>
    zRangeByLex(byte[] key, Range<byte[]> range)
    Get all the elements in Range from the sorted set at key in lexicographical ordering.
    Set<byte[]>
    zRangeByLex(byte[] key, Range<byte[]> range, Limit limit)
    Get all the elements in Range from the sorted set at key in lexicographical ordering.
    default Set<byte[]>
    zRangeByScore(byte[] key, double min, double max)
    Get elements where score is between min and max from sorted set.
    default Set<byte[]>
    zRangeByScore(byte[] 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.
    default Set<byte[]>
    zRangeByScore(byte[] key, String min, String max)
    Set<byte[]>
    zRangeByScore(byte[] key, String min, String max, long offset, long count)
    Get elements in range from start to end where score is between min and max from sorted set.
    default Set<byte[]>
    zRangeByScore(byte[] key, Range<? extends Number> range)
    Get elements where score is between Range#min and Range#max from sorted set.
    Set<byte[]>
    zRangeByScore(byte[] key, Range<? extends Number> range, Limit limit)
    Get elements in range from Limit#count to Limit#offset where score is between Range#min and Range#max from sorted set.
    default Set<Tuple>
    zRangeByScoreWithScores(byte[] key, double min, double max)
    Get set of Tuples where score is between min and max from sorted set.
    default Set<Tuple>
    zRangeByScoreWithScores(byte[] 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.
    default Set<Tuple>
    zRangeByScoreWithScores(byte[] key, Range<? extends Number> range)
    Get set of Tuples where score is between Range#min and Range#max from sorted set.
    zRangeByScoreWithScores(byte[] key, Range<? extends Number> range, Limit limit)
    Get set of Tuples in range from Limit#offset to Limit#offset + Limit#count where score is between Range#min and Range#max from sorted set.
    default Long
    zRangeStoreByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range)
    This command is like ZRANGE , but stores the result in the dstKey destination key.
    zRangeStoreByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range, Limit limit)
    This command is like ZRANGE , but stores the result in the dstKey destination key.
    default Long
    zRangeStoreByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range)
    This command is like ZRANGE, but stores the result in the dstKey destination key.
    zRangeStoreByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range, Limit limit)
    This command is like ZRANGE, but stores the result in the dstKey destination key.
    default Long
    zRangeStoreRevByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range)
    This command is like ZRANGE … REV , but stores the result in the dstKey destination key.
    zRangeStoreRevByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range, Limit limit)
    This command is like ZRANGE … REV , but stores the result in the dstKey destination key.
    default Long
    zRangeStoreRevByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range)
    This command is like ZRANGE … REV, but stores the result in the dstKey destination key.
    zRangeStoreRevByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range, Limit limit)
    This command is like ZRANGE … REV, but stores the result in the dstKey destination key.
    zRangeWithScores(byte[] key, long start, long end)
    Get set of Tuples between start and end from sorted set.
    zRank(byte[] key, byte[] value)
    Determine the index of element with value in a sorted set.
    zRem(byte[] key, byte[]... values)
    Remove values from sorted set.
    zRemRange(byte[] key, long start, long end)
    Remove elements in range between start and end from sorted set with key.
    zRemRangeByLex(byte[] key, Range<byte[]> range)
    Remove all elements between the lexicographical Range.
    default Long
    zRemRangeByScore(byte[] key, double min, double max)
    Remove elements with scores between min and max from sorted set with key.
    zRemRangeByScore(byte[] key, Range<? extends Number> range)
    Remove elements with scores between Range#min and Range#max from sorted set with key.
    Set<byte[]>
    zRevRange(byte[] key, long start, long end)
    Get elements in range from start to end from sorted set ordered from high to low.
    default Set<byte[]>
    zRevRangeByLex(byte[] key)
    Get all the elements in the sorted set at key in reversed lexicographical ordering.
    default Set<byte[]>
    zRevRangeByLex(byte[] key, Range<byte[]> range)
    Get all the elements in Range from the sorted set at key in reversed lexicographical ordering.
    Set<byte[]>
    zRevRangeByLex(byte[] key, Range<byte[]> range, Limit limit)
    Get all the elements in Range from the sorted set at key in reversed lexicographical ordering.
    default Set<byte[]>
    zRevRangeByScore(byte[] key, double min, double max)
    Get elements where score is between min and max from sorted set ordered from high to low.
    default Set<byte[]>
    zRevRangeByScore(byte[] 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.
    default Set<byte[]>
    zRevRangeByScore(byte[] key, Range<? extends Number> range)
    Get elements where score is between Range#min and Range#max from sorted set ordered from high to low.
    Set<byte[]>
    zRevRangeByScore(byte[] key, Range<? extends Number> range, Limit limit)
    Get elements in range from Limit#offset to Limit#offset + Limit#count where score is between Range#min and Range#max from sorted set ordered high -> low.
    default Set<Tuple>
    zRevRangeByScoreWithScores(byte[] key, double min, double max)
    Get set of Tuple where score is between min and max from sorted set ordered from high to low.
    default Set<Tuple>
    zRevRangeByScoreWithScores(byte[] 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.
    default Set<Tuple>
    zRevRangeByScoreWithScores(byte[] key, Range<? extends Number> range)
    Get set of Tuple where score is between Range#min and Range#max from sorted set ordered from high to low.
    zRevRangeByScoreWithScores(byte[] key, Range<? extends Number> range, Limit limit)
    Get set of Tuple in range from Limit#offset to Limit#count where score is between Range#min and Range#max from sorted set ordered high -> low.
    zRevRangeWithScores(byte[] key, long start, long end)
    Get set of Tuples in range from start to end from sorted set ordered from high to low.
    zRevRank(byte[] key, byte[] value)
    Determine the index of element with value in a sorted set when scored high to low.
    zScan(byte[] key, ScanOptions options)
    Use a Cursor to iterate over elements in sorted set at key.
    zScore(byte[] key, byte[] value)
    Get the score of element with value from sorted set with key key.
    Set<byte[]>
    zUnion(byte[]... sets)
    Union sorted sets.
    zUnionStore(byte[] destKey, byte[]... sets)
    Union sorted sets.
    default Long
    zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets)
    Union sorted sets and store result in destination destKey.
    zUnionStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets)
    Union sorted sets and store result in destination destKey.
    zUnionWithScores(byte[]... sets)
    Union sorted sets.
    default Set<Tuple>
    zUnionWithScores(Aggregate aggregate, int[] weights, byte[]... sets)
    Union sorted sets.
    zUnionWithScores(Aggregate aggregate, Weights weights, byte[]... sets)
    Union sorted sets.
  • Method Details

    • zAdd

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

      @Nullable Boolean zAdd(byte[] key, double score, byte[] value, RedisZSetCommands.ZAddArgs args)
      Add value to a sorted set at key, or update its score depending on the given args.
      Parameters:
      key - must not be null.
      score - the score.
      value - the value.
      args - must not be null use RedisZSetCommands.ZAddArgs.empty() instead.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.5
      See Also:
    • zAdd

      @Nullable default Long zAdd(byte[] key, Set<Tuple> tuples)
      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:
    • zAdd

      Long zAdd(byte[] key, Set<Tuple> tuples, RedisZSetCommands.ZAddArgs args)
      Add tuples to a sorted set at key, or update its score depending on the given args.
      Parameters:
      key - must not be null.
      tuples - must not be null.
      args - must not be null use RedisZSetCommands.ZAddArgs.empty() instead.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.5
      See Also:
    • zRem

      @Nullable Long zRem(byte[] key, byte[]... 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:
    • zIncrBy

      @Nullable Double zIncrBy(byte[] key, double increment, byte[] value)
      Increment the score of element with value in sorted set by increment.
      Parameters:
      key - must not be null.
      increment -
      value - the value.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zRandMember

      @Nullable byte[] zRandMember(byte[] key)
      Get random element from sorted set at key.
      Parameters:
      key - must not be null.
      Returns:
      can be null.
      Since:
      2.6
      See Also:
    • zRandMember

      @Nullable List<byte[]> zRandMember(byte[] key, long count)
      Get count random elements from sorted set at key.
      Parameters:
      key - must not be null.
      count - if the provided count argument is positive, return a list of distinct fields, capped either at count or the set size. If count is negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zRandMemberWithScore

      @Nullable Tuple zRandMemberWithScore(byte[] key)
      Get random element from sorted set at key.
      Parameters:
      key - must not be null.
      Returns:
      can be null.
      Since:
      2.6
      See Also:
    • zRandMemberWithScore

      @Nullable List<Tuple> zRandMemberWithScore(byte[] key, long count)
      Get count random elements from sorted set at key.
      Parameters:
      key - must not be null.
      count - if the provided count argument is positive, return a list of distinct fields, capped either at count or the set size. If count is negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zRank

      @Nullable Long zRank(byte[] key, byte[] value)
      Determine the index of element with value in a sorted set.
      Parameters:
      key - must not be null.
      value - the value. Must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zRevRank

      @Nullable Long zRevRank(byte[] key, byte[] value)
      Determine the index of element with value in a sorted set when scored high to low.
      Parameters:
      key - must not be null.
      value - the value.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zRange

      @Nullable Set<byte[]> zRange(byte[] key, long start, long end)
      Get elements between start and end from sorted set.
      Parameters:
      key - must not be null.
      start -
      end -
      Returns:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRangeWithScores

      @Nullable Set<Tuple> zRangeWithScores(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRangeByScore

      @Nullable default Set<byte[]> zRangeByScore(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRangeByScoreWithScores

      @Nullable default Set<Tuple> zRangeByScoreWithScores(byte[] key, Range<? extends Number> range)
      Get set of Tuples where score is between Range#min and Range#max from sorted set.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRangeByScoreWithScores

      @Nullable default Set<Tuple> zRangeByScoreWithScores(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRangeByScore

      @Nullable default Set<byte[]> zRangeByScore(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRangeByScoreWithScores

      @Nullable default Set<Tuple> zRangeByScoreWithScores(byte[] 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 - must not be null.
      min -
      max -
      offset -
      count -
      Returns:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRangeByScoreWithScores

      @Nullable Set<Tuple> zRangeByScoreWithScores(byte[] key, Range<? extends Number> range, Limit limit)
      Get set of Tuples in range from Limit#offset to Limit#offset + Limit#count where score is between Range#min and Range#max from sorted set.
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRevRange

      @Nullable Set<byte[]> zRevRange(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRevRangeWithScores

      @Nullable Set<Tuple> zRevRangeWithScores(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRevRangeByScore

      @Nullable default Set<byte[]> zRevRangeByScore(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRevRangeByScore

      @Nullable default Set<byte[]> zRevRangeByScore(byte[] key, Range<? extends Number> range)
      Get elements where score is between Range#min and Range#max from sorted set ordered from high to low.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRevRangeByScoreWithScores

      @Nullable default Set<Tuple> zRevRangeByScoreWithScores(byte[] 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:
      empty Set when key does not exists or no members in range. null when used in pipeline / transaction.
      See Also:
    • zRevRangeByScore

      @Nullable default Set<byte[]> zRevRangeByScore(byte[] 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:
    • zRevRangeByScore

      @Nullable Set<byte[]> zRevRangeByScore(byte[] key, Range<? extends Number> range, Limit limit)
      Get elements in range from Limit#offset to Limit#offset + Limit#count where score is between Range#min and Range#max from sorted set ordered high -> low.
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRevRangeByScoreWithScores

      @Nullable default Set<Tuple> zRevRangeByScoreWithScores(byte[] 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:
    • zRevRangeByScoreWithScores

      @Nullable default Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range<? extends Number> range)
      Get set of Tuple where score is between Range#min and Range#max from sorted set ordered from high to low.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRevRangeByScoreWithScores

      @Nullable Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range<? extends Number> range, Limit limit)
      Get set of Tuple in range from Limit#offset to Limit#count where score is between Range#min and Range#max from sorted set ordered high -> low.
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zCount

      @Nullable default Long zCount(byte[] 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:
    • zCount

      @Nullable Long zCount(byte[] key, Range<? extends Number> range)
      Count number of elements within sorted set with scores between Range#min and Range#max.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zLexCount

      @Nullable Long zLexCount(byte[] key, Range<byte[]> range)
      Count number of elements within sorted set with value between Range#min and Range#max 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:
    • zPopMin

      @Nullable Tuple zPopMin(byte[] key)
      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:
    • zPopMin

      @Nullable Set<Tuple> zPopMin(byte[] 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:
    • bZPopMin

      @Nullable Tuple bZPopMin(byte[] 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:
    • zPopMax

      @Nullable Tuple zPopMax(byte[] key)
      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:
    • zPopMax

      @Nullable Set<Tuple> zPopMax(byte[] 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:
    • bZPopMax

      @Nullable Tuple bZPopMax(byte[] 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:
    • zCard

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

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

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

      @Nullable Long zRemRange(byte[] 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:
    • zRemRangeByLex

      Long zRemRangeByLex(byte[] key, Range<byte[]> range)
      Remove all elements between the lexicographical Range.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      the number of elements removed, or null when used in pipeline / transaction.
      Since:
      2.5
      See Also:
    • zRemRangeByScore

      @Nullable default Long zRemRangeByScore(byte[] 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:
    • zRemRangeByScore

      @Nullable Long zRemRangeByScore(byte[] key, Range<? extends Number> range)
      Remove elements with scores between Range#min and Range#max from sorted set with key.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zDiff

      @Nullable Set<byte[]> zDiff(byte[]... sets)
      Diff sorted sets.
      Parameters:
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zDiffWithScores

      @Nullable Set<Tuple> zDiffWithScores(byte[]... sets)
      Diff sorted sets.
      Parameters:
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zDiffStore

      @Nullable Long zDiffStore(byte[] destKey, byte[]... sets)
      Diff sorted sets and store result in destination destKey.
      Parameters:
      destKey - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zInter

      @Nullable Set<byte[]> zInter(byte[]... sets)
      Intersect sorted sets.
      Parameters:
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zInterWithScores

      @Nullable Set<Tuple> zInterWithScores(byte[]... sets)
      Intersect sorted sets.
      Parameters:
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zInterWithScores

      @Nullable default Set<Tuple> zInterWithScores(Aggregate aggregate, int[] weights, byte[]... sets)
      Intersect sorted sets.
      Parameters:
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      Since:
      2.6
      See Also:
    • zInterWithScores

      @Nullable Set<Tuple> zInterWithScores(Aggregate aggregate, Weights weights, byte[]... sets)
      Intersect sorted sets.
      Parameters:
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      Since:
      2.6
      See Also:
    • zInterStore

      @Nullable Long zInterStore(byte[] destKey, byte[]... sets)
      Intersect sorted sets and store result in destination destKey.
      Parameters:
      destKey - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zInterStore

      @Nullable default Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets)
      Intersect sorted sets and store result in destination destKey.
      Parameters:
      destKey - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zInterStore

      @Nullable Long zInterStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets)
      Intersect sorted sets and store result in destination destKey.
      Parameters:
      destKey - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.1
      See Also:
    • zUnion

      @Nullable Set<byte[]> zUnion(byte[]... sets)
      Union sorted sets.
      Parameters:
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zUnionWithScores

      @Nullable Set<Tuple> zUnionWithScores(byte[]... sets)
      Union sorted sets.
      Parameters:
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zUnionWithScores

      @Nullable default Set<Tuple> zUnionWithScores(Aggregate aggregate, int[] weights, byte[]... sets)
      Union sorted sets.
      Parameters:
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zUnionWithScores

      @Nullable Set<Tuple> zUnionWithScores(Aggregate aggregate, Weights weights, byte[]... sets)
      Union sorted sets.
      Parameters:
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • zUnionStore

      @Nullable Long zUnionStore(byte[] destKey, byte[]... sets)
      Union sorted sets.
      Parameters:
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zUnionStore

      @Nullable default Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets)
      Union sorted sets and store result in destination destKey.
      Parameters:
      destKey - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • zUnionStore

      @Nullable Long zUnionStore(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets)
      Union sorted sets and store result in destination destKey.
      Parameters:
      destKey - must not be null.
      aggregate - must not be null.
      weights - must not be null.
      sets - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.1
      See Also:
    • zScan

      Cursor<Tuple> zScan(byte[] key, ScanOptions options)
      Use a Cursor to iterate over elements in sorted set at key.
      Parameters:
      key - must not be null.
      options - must not be null.
      Returns:
      Since:
      1.4
      See Also:
    • zRangeByScore

      @Nullable @Deprecated default Set<byte[]> zRangeByScore(byte[] key, String min, String 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.
      Since:
      1.5
      See Also:
    • zRangeByScore

      @Nullable default Set<byte[]> zRangeByScore(byte[] key, Range<? extends Number> range)
      Get elements where score is between Range#min and Range#max from sorted set.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRangeByScore

      @Nullable Set<byte[]> zRangeByScore(byte[] key, String min, String 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 - must not be null.
      max - must not be null.
      offset -
      count -
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.5
      See Also:
    • zRangeByScore

      @Nullable Set<byte[]> zRangeByScore(byte[] key, Range<? extends Number> range, Limit limit)
      Get elements in range from Limit#count to Limit#offset where score is between Range#min and Range#max from sorted set.
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRangeByLex

      @Nullable default Set<byte[]> zRangeByLex(byte[] key)
      Get all the elements in the sorted set at key in lexicographical ordering.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRangeByLex

      @Nullable default Set<byte[]> zRangeByLex(byte[] key, Range<byte[]> range)
      Get all the elements in Range from the sorted set at key in lexicographical ordering.
      Parameters:
      key - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRangeByLex

      @Nullable Set<byte[]> zRangeByLex(byte[] key, Range<byte[]> range, Limit limit)
      Get all the elements in Range from the sorted set at key in lexicographical ordering. Result is limited via RedisZSetCommands.Limit.
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      1.6
      See Also:
    • zRevRangeByLex

      @Nullable default Set<byte[]> zRevRangeByLex(byte[] key)
      Get all the elements in the sorted set at key in reversed lexicographical ordering.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.4
      See Also:
    • zRevRangeByLex

      @Nullable default Set<byte[]> zRevRangeByLex(byte[] key, Range<byte[]> range)
      Get all the elements in Range from the sorted set at key in reversed 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:
    • zRevRangeByLex

      @Nullable Set<byte[]> zRevRangeByLex(byte[] key, Range<byte[]> range, Limit limit)
      Get all the elements in Range from the sorted set at key in reversed lexicographical ordering. Result is limited via RedisZSetCommands.Limit.
      Parameters:
      key - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.4
      See Also:
    • zRangeStoreByLex

      @Nullable default Long zRangeStoreByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range)
      This command is like ZRANGE , but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • zRangeStoreByLex

      @Nullable Long zRangeStoreByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range, Limit limit)
      This command is like ZRANGE , but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • zRangeStoreRevByLex

      @Nullable default Long zRangeStoreRevByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range)
      This command is like ZRANGE … REV , but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • zRangeStoreRevByLex

      @Nullable Long zRangeStoreRevByLex(byte[] dstKey, byte[] srcKey, Range<byte[]> range, Limit limit)
      This command is like ZRANGE … REV , but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • zRangeStoreByScore

      @Nullable default Long zRangeStoreByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range)
      This command is like ZRANGE, but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • zRangeStoreByScore

      @Nullable Long zRangeStoreByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range, Limit limit)
      This command is like ZRANGE, but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • zRangeStoreRevByScore

      @Nullable default Long zRangeStoreRevByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range)
      This command is like ZRANGE … REV, but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • zRangeStoreRevByScore

      @Nullable Long zRangeStoreRevByScore(byte[] dstKey, byte[] srcKey, Range<? extends Number> range, Limit limit)
      This command is like ZRANGE … REV, but stores the result in the dstKey destination key.
      Parameters:
      dstKey - must not be null.
      srcKey - must not be null.
      range - must not be null.
      limit - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also: