Interface RedisZSetCommands

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

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

    • zAdd

      default Boolean zAdd(byte @NonNull [] key, double score, byte @NonNull [] 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

      Boolean zAdd(byte @NonNull [] key, double score, byte @NonNull [] value, @NonNull 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

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

      Long zRem(byte @NonNull [] key, byte @NonNull [] @NonNull ... 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

      Double zIncrBy(byte @NonNull [] key, double increment, byte @NonNull [] 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

      byte @NonNull [] zRandMember(byte @NonNull [] 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

      List<byte @NonNull []> zRandMember(byte @NonNull [] 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

      Tuple zRandMemberWithScore(byte @NonNull [] 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

      List<@NonNull Tuple> zRandMemberWithScore(byte @NonNull [] 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

      Long zRank(byte @NonNull [] key, byte @NonNull [] 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

      Long zRevRank(byte @NonNull [] key, byte @NonNull [] 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

      Set<byte @NonNull []> zRange(byte @NonNull [] 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

      Set<@NonNull Tuple> zRangeWithScores(byte @NonNull [] 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

      default Set<byte @NonNull []> zRangeByScore(byte @NonNull [] 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

      default Set<@NonNull Tuple> zRangeByScoreWithScores(byte @NonNull [] key, @NonNull Range<? extends @NonNull 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

      default Set<@NonNull Tuple> zRangeByScoreWithScores(byte @NonNull [] 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

      default Set<byte @NonNull []> zRangeByScore(byte @NonNull [] 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

      default Set<@NonNull Tuple> zRangeByScoreWithScores(byte @NonNull [] 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

      Set<@NonNull Tuple> zRangeByScoreWithScores(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range, @NonNull 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

      Set<byte @NonNull []> zRevRange(byte @NonNull [] 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

      Set<@NonNull Tuple> zRevRangeWithScores(byte @NonNull [] 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

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

      default Set<byte @NonNull []> zRevRangeByScore(byte @NonNull [] key, @NonNull Range<? extends @NonNull 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

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

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

      Set<byte @NonNull []> zRevRangeByScore(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range, @NonNull 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

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

      default Set<@NonNull Tuple> zRevRangeByScoreWithScores(byte @NonNull [] key, @NonNull Range<? extends @NonNull 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

      Set<@NonNull Tuple> zRevRangeByScoreWithScores(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range, @NonNull 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

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

      Long zCount(byte @NonNull [] key, @NonNull Range<? extends @NonNull 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

      Long zLexCount(byte @NonNull [] key, @NonNull Range<byte @NonNull []> 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

      Tuple zPopMin(byte @NonNull [] 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

      Set<@NonNull Tuple> zPopMin(byte @NonNull [] 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

      Tuple bZPopMin(byte @NonNull [] key, long timeout, @NonNull 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

      Tuple zPopMax(byte @NonNull [] 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

      Set<@NonNull Tuple> zPopMax(byte @NonNull [] 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

      Tuple bZPopMax(byte @NonNull [] key, long timeout, @NonNull 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

      Long zCard(byte @NonNull [] 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

      Double zScore(byte @NonNull [] key, byte @NonNull [] 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

      List<@NonNull Double> zMScore(byte @NonNull [] key, byte @NonNull [] @NonNull ... 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

      Long zRemRange(byte @NonNull [] 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 @NonNull [] key, @NonNull Range<byte @NonNull []> 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

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

      Long zRemRangeByScore(byte @NonNull [] key, @NonNull Range<? extends @NonNull 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

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

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

      Long zDiffStore(byte @NonNull [] destKey, byte @NonNull [] @NonNull ... 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

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

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

      default Set<@NonNull Tuple> zInterWithScores(@NonNull Aggregate aggregate, int[] weights, byte @NonNull [] @NonNull ... 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

      Set<@NonNull Tuple> zInterWithScores(@NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... 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

      Long zInterStore(byte @NonNull [] destKey, byte @NonNull [] @NonNull ... 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

      default Long zInterStore(byte @NonNull [] destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, byte @NonNull [] @NonNull ... 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

      Long zInterStore(byte @NonNull [] destKey, @NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... 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

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

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

      default @Nullable Set<@NonNull Tuple> zUnionWithScores(@NonNull Aggregate aggregate, int @NonNull [] weights, byte @NonNull [] @NonNull ... 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

      Set<@NonNull Tuple> zUnionWithScores(@NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... 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

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

      default Long zUnionStore(byte @NonNull [] destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, byte @NonNull [] @NonNull ... 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

      Long zUnionStore(byte @NonNull [] destKey, @NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... 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<@NonNull Tuple> zScan(byte @NonNull [] key, @Nullable 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

      @Deprecated default Set<byte @NonNull []> zRangeByScore(byte @NonNull [] key, @NonNull String min, @NonNull 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

      default Set<byte @NonNull []> zRangeByScore(byte @NonNull [] key, @NonNull Range<? extends @NonNull 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

      Set<byte @NonNull []> zRangeByScore(byte @NonNull [] key, @NonNull String min, @NonNull 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

      Set<byte @NonNull []> zRangeByScore(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range, @NonNull 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

      default Set<byte @NonNull []> zRangeByLex(byte @NonNull [] 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

      default Set<byte @NonNull []> zRangeByLex(byte @NonNull [] key, @NonNull Range<byte @NonNull []> 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

      Set<byte @NonNull []> zRangeByLex(byte @NonNull [] key, @NonNull Range<byte @NonNull []> range, @NonNull 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

      default Set<byte @NonNull []> zRevRangeByLex(byte @NonNull [] 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

      default Set<byte @NonNull []> zRevRangeByLex(byte @NonNull [] key, @NonNull Range<byte @NonNull []> 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

      Set<byte @NonNull []> zRevRangeByLex(byte @NonNull [] key, @NonNull Range<byte @NonNull []> range, @NonNull 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

      default Long zRangeStoreByLex(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<byte @NonNull []> 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

      Long zRangeStoreByLex(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<byte @NonNull []> range, @NonNull 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

      default Long zRangeStoreRevByLex(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<byte @NonNull []> 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

      Long zRangeStoreRevByLex(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<byte @NonNull []> range, @NonNull 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

      default Long zRangeStoreByScore(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<? extends @NonNull 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

      Long zRangeStoreByScore(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<? extends @NonNull Number> range, @NonNull 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

      default Long zRangeStoreRevByScore(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<? extends @NonNull 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

      Long zRangeStoreRevByScore(byte @NonNull [] dstKey, byte @NonNull [] srcKey, @NonNull Range<? extends @NonNull Number> range, @NonNull 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: