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 ClassesModifier and TypeInterfaceDescriptionstatic class
Deprecated.static class
Deprecated.since 3.0, useRange
orRedisZSetCommands.Range.toRange()
instead.static class
ZADD
specific arguments. -
Method Summary
Modifier and TypeMethodDescriptionRemove and return the value with its score having the highest score from sorted set atkey
.Remove and return the value with its score having the lowest score from sorted set atkey
.default Boolean
zAdd
(byte @NonNull [] key, double score, byte @NonNull [] value) Addvalue
to a sorted set atkey
, or update itsscore
if it already exists.zAdd
(byte @NonNull [] key, double score, byte @NonNull [] value, @NonNull RedisZSetCommands.ZAddArgs args) default Long
Addtuples
to a sorted set atkey
, or update itsscore
if it already exists.zAdd
(byte @NonNull [] key, @NonNull Set<@NonNull Tuple> tuples, @NonNull RedisZSetCommands.ZAddArgs args) zCard
(byte @NonNull [] key) Get the size of sorted set withkey
.default Long
zCount
(byte @NonNull [] key, double min, double max) Count number of elements within sorted set with scores betweenmin
andmax
.Count number of elements within sorted set with scores betweenRange#min
andRange#max
.Set<byte[]>
zDiff
(byte @NonNull [] @NonNull ... sets) Diff sortedsets
.zDiffStore
(byte @NonNull [] destKey, byte @NonNull [] @NonNull ... sets) Diff sortedsets
and store result in destinationdestKey
.zDiffWithScores
(byte @NonNull [] @NonNull ... sets) Diff sortedsets
.zIncrBy
(byte @NonNull [] key, double increment, byte @NonNull [] value) Increment the score of element withvalue
in sorted set byincrement
.Set<byte @NonNull []>
zInter
(byte @NonNull [] @NonNull ... sets) Intersect sortedsets
.zInterStore
(byte @NonNull [] destKey, byte @NonNull [] @NonNull ... sets) Intersect sortedsets
and store result in destinationdestKey
.default Long
zInterStore
(byte @NonNull [] destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, byte @NonNull [] @NonNull ... sets) Intersect sortedsets
and store result in destinationdestKey
.zInterStore
(byte @NonNull [] destKey, @NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... sets) Intersect sortedsets
and store result in destinationdestKey
.zInterWithScores
(byte @NonNull [] @NonNull ... sets) Intersect sortedsets
.zInterWithScores
(@NonNull Aggregate aggregate, int[] weights, byte @NonNull [] @NonNull ... sets) Intersect sortedsets
.zInterWithScores
(@NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... sets) Intersect sortedsets
.Count number of elements within sorted set with value betweenRange#min
andRange#max
applying lexicographical ordering.zMScore
(byte @NonNull [] key, byte @NonNull [] @NonNull ... values) Get the scores of elements withvalues
from sorted set with keykey
.zPopMax
(byte @NonNull [] key) Remove and return the value with its score having the highest score from sorted set atkey
.zPopMax
(byte @NonNull [] key, long count) Remove and returncount
values with their score having the highest score from sorted set atkey
.zPopMin
(byte @NonNull [] key) Remove and return the value with its score having the lowest score from sorted set atkey
.zPopMin
(byte @NonNull [] key, long count) Remove and returncount
values with their score having the lowest score from sorted set atkey
.byte @NonNull []
zRandMember
(byte @NonNull [] key) Get random element from sorted set atkey
.List<byte @NonNull []>
zRandMember
(byte @NonNull [] key, long count) Getcount
random elements from sorted set atkey
.zRandMemberWithScore
(byte @NonNull [] key) Get random element from sorted set atkey
.zRandMemberWithScore
(byte @NonNull [] key, long count) Getcount
random elements from sorted set atkey
.Set<byte @NonNull []>
zRange
(byte @NonNull [] key, long start, long end) Get elements betweenstart
andend
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 inRange
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 inRange
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 betweenmin
andmax
from sorted set.default Set<byte @NonNull []>
zRangeByScore
(byte @NonNull [] key, double min, double max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.default Set<byte @NonNull []>
zRangeByScore
(byte @NonNull [] key, @NonNull String min, @NonNull String max) Deprecated.since 3.0, usezRangeByScore(byte[], org.springframework.data.domain.Range)
instead.Set<byte @NonNull []>
zRangeByScore
(byte @NonNull [] key, @NonNull String min, @NonNull String max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.default Set<byte @NonNull []>
zRangeByScore
(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range) Get elements where score is betweenRange#min
andRange#max
from sorted set.Set<byte @NonNull []>
zRangeByScore
(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range, @NonNull Limit limit) Get elements in range fromLimit#count
toLimit#offset
where score is betweenRange#min
andRange#max
from sorted set.zRangeByScoreWithScores
(byte @NonNull [] key, double min, double max) zRangeByScoreWithScores
(byte @NonNull [] key, double min, double max, long offset, long count) zRangeByScoreWithScores
(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range) zRangeByScoreWithScores
(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range, @NonNull Limit limit) Get set ofTuple
s in range fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#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.zRangeWithScores
(byte @NonNull [] key, long start, long end) zRank
(byte @NonNull [] key, byte @NonNull [] value) Determine the index of element withvalue
in a sorted set.zRem
(byte @NonNull [] key, byte @NonNull [] @NonNull ... values) Removevalues
from sorted set.zRemRange
(byte @NonNull [] key, long start, long end) Remove elements in range betweenstart
andend
from sorted set withkey
.zRemRangeByLex
(byte @NonNull [] key, @NonNull Range<byte @NonNull []> range) Remove all elements between the lexicographicalRange
.default Long
zRemRangeByScore
(byte @NonNull [] key, double min, double max) Remove elements with scores betweenmin
andmax
from sorted set withkey
.zRemRangeByScore
(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range) Remove elements with scores betweenRange#min
andRange#max
from sorted set withkey
.Set<byte @NonNull []>
zRevRange
(byte @NonNull [] key, long start, long end) Get elements in range fromstart
toend
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 inRange
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 inRange
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 betweenmin
andmax
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 fromstart
toend
where score is betweenmin
andmax
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 betweenRange#min
andRange#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 fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#max
from sorted set ordered high -> low.zRevRangeByScoreWithScores
(byte @NonNull [] key, double min, double max) zRevRangeByScoreWithScores
(byte @NonNull [] key, double min, double max, long offset, long count) Get set ofTuple
in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.zRevRangeByScoreWithScores
(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range) Get set ofTuple
where score is betweenRange#min
andRange#max
from sorted set ordered from high to low.zRevRangeByScoreWithScores
(byte @NonNull [] key, @NonNull Range<? extends @NonNull Number> range, @NonNull Limit limit) Get set ofTuple
in range fromLimit#offset
toLimit#count
where score is betweenRange#min
andRange#max
from sorted set ordered high -> low.zRevRangeWithScores
(byte @NonNull [] key, long start, long end) zRevRank
(byte @NonNull [] key, byte @NonNull [] value) Determine the index of element withvalue
in a sorted set when scored high to low.zScan
(byte @NonNull [] key, @Nullable ScanOptions options) Use aCursor
to iterate over elements in sorted set atkey
.zScore
(byte @NonNull [] key, byte @NonNull [] value) Get the score of element withvalue
from sorted set with keykey
.Set<byte @NonNull []>
zUnion
(byte @NonNull [] @NonNull ... sets) Union sortedsets
.zUnionStore
(byte @NonNull [] destKey, byte @NonNull [] @NonNull ... sets) Union sortedsets
.default Long
zUnionStore
(byte @NonNull [] destKey, @NonNull Aggregate aggregate, int @NonNull [] weights, byte @NonNull [] @NonNull ... sets) Union sortedsets
and store result in destinationdestKey
.zUnionStore
(byte @NonNull [] destKey, @NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... sets) Union sortedsets
and store result in destinationdestKey
.zUnionWithScores
(byte @NonNull [] @NonNull ... sets) Union sortedsets
.zUnionWithScores
(@NonNull Aggregate aggregate, int @NonNull [] weights, byte @NonNull [] @NonNull ... sets) Union sortedsets
.zUnionWithScores
(@NonNull Aggregate aggregate, @NonNull Weights weights, byte @NonNull [] @NonNull ... sets) Union sortedsets
.
-
Method Details
-
zAdd
Addvalue
to a sorted set atkey
, or update itsscore
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) - Parameters:
key
- must not be null.score
- the score.value
- the value.args
- must not be null useRedisZSetCommands.ZAddArgs.empty()
instead.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
zAdd
Addtuples
to a sorted set atkey
, or update itsscore
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) - Parameters:
key
- must not be null.tuples
- must not be null.args
- must not be null useRedisZSetCommands.ZAddArgs.empty()
instead.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
zRem
Removevalues
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
Increment the score of element withvalue
in sorted set byincrement
.- 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 atkey
.- Parameters:
key
- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zRandMember
Getcount
random elements from sorted set atkey
.- Parameters:
key
- must not be null.count
- if the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the set size. Ifcount
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
Get random element from sorted set atkey
.- Parameters:
key
- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zRandMemberWithScore
Getcount
random elements from sorted set atkey
.- Parameters:
key
- must not be null.count
- if the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the set size. Ifcount
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
Determine the index of element withvalue
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
Determine the index of element withvalue
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
Get elements betweenstart
andend
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
- 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
Get elements where score is betweenmin
andmax
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) - 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
- 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 fromstart
toend
where score is betweenmin
andmax
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) - 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 ofTuple
s in range fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#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
Get elements in range fromstart
toend
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
- 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
Get elements where score is betweenmin
andmax
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 betweenRange#min
andRange#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) - 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 fromstart
toend
where score is betweenmin
andmax
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 fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#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 ofTuple
in range fromstart
toend
where score is betweenmin
andmax
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 ofTuple
where score is betweenRange#min
andRange#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 ofTuple
in range fromLimit#offset
toLimit#count
where score is betweenRange#min
andRange#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
Count number of elements within sorted set with scores betweenmin
andmax
.- Parameters:
key
- must not be null.min
-max
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zCount
Count number of elements within sorted set with scores betweenRange#min
andRange#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
Count number of elements within sorted set with value betweenRange#min
andRange#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
Remove and return the value with its score having the lowest score from sorted set atkey
.- 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
Remove and returncount
values with their score having the lowest score from sorted set atkey
.- 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
Remove and return the value with its score having the lowest score from sorted set atkey
.
Blocks connection until element available ortimeout
reached.- Parameters:
key
- must not be null.timeout
-unit
- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zPopMax
Remove and return the value with its score having the highest score from sorted set atkey
.- 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
Remove and returncount
values with their score having the highest score from sorted set atkey
.- 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
Remove and return the value with its score having the highest score from sorted set atkey
.
Blocks connection until element available ortimeout
reached.- Parameters:
key
- must not be null.timeout
-unit
- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zCard
Get the size of sorted set withkey
.- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zScore
Get the score of element withvalue
from sorted set with keykey
.- Parameters:
key
- must not be null.value
- the value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zMScore
Get the scores of elements withvalues
from sorted set with keykey
.- Parameters:
key
- must not be null.values
- the values.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zRemRange
Remove elements in range betweenstart
andend
from sorted set withkey
.- Parameters:
key
- must not be null.start
-end
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRemRangeByLex
Remove all elements between the lexicographicalRange
.- 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
Remove elements with scores betweenmin
andmax
from sorted set withkey
.- Parameters:
key
- must not be null.min
-max
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRemRangeByScore
Remove elements with scores betweenRange#min
andRange#max
from sorted set withkey
.- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 1.6
- See Also:
-
zDiff
Diff sortedsets
.- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zDiffWithScores
Diff sortedsets
.- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zDiffStore
Diff sortedsets
and store result in destinationdestKey
.- Parameters:
destKey
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInter
Intersect sortedsets
.- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInterWithScores
Intersect sortedsets
.- 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 sortedsets
.- 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 sortedsets
.- Parameters:
aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
zInterStore
Intersect sortedsets
and store result in destinationdestKey
.- 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 sortedsets
and store result in destinationdestKey
.- 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 sortedsets
and store result in destinationdestKey
.- 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
Union sortedsets
.- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionWithScores
Union sortedsets
.- 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 sortedsets
.- 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 sortedsets
.- 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
Union sortedsets
.- 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 sortedsets
and store result in destinationdestKey
.- 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 sortedsets
and store result in destinationdestKey
.- 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
Use aCursor
to iterate over elements in sorted set atkey
.- 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) Deprecated.since 3.0, usezRangeByScore(byte[], org.springframework.data.domain.Range)
instead.Get elements where score is betweenmin
andmax
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 betweenRange#min
andRange#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 fromstart
toend
where score is betweenmin
andmax
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 fromLimit#count
toLimit#offset
where score is betweenRange#min
andRange#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
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 inRange
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 inRange
from the sorted set at key in lexicographical ordering. Result is limited viaRedisZSetCommands.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
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 inRange
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 inRange
from the sorted set at key in reversed lexicographical ordering. Result is limited viaRedisZSetCommands.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:
-
Limit
instead.