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
Modifier 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[] key, double score, byte[] value) Addvalue
to a sorted set atkey
, or update itsscore
if it already exists.zAdd
(byte[] key, double score, byte[] value, RedisZSetCommands.ZAddArgs args) default Long
Addtuples
to a sorted set atkey
, or update itsscore
if it already exists.zAdd
(byte[] key, Set<Tuple> tuples, RedisZSetCommands.ZAddArgs args) zCard
(byte[] key) Get the size of sorted set withkey
.default Long
zCount
(byte[] 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[]... sets) Diff sortedsets
.zDiffStore
(byte[] destKey, byte[]... sets) Diff sortedsets
and store result in destinationdestKey
.zDiffWithScores
(byte[]... sets) Diff sortedsets
.zIncrBy
(byte[] key, double increment, byte[] value) Increment the score of element withvalue
in sorted set byincrement
.Set<byte[]>
zInter
(byte[]... sets) Intersect sortedsets
.zInterStore
(byte[] destKey, byte[]... sets) Intersect sortedsets
and store result in destinationdestKey
.default Long
zInterStore
(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Intersect sortedsets
and store result in destinationdestKey
.zInterStore
(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) Intersect sortedsets
and store result in destinationdestKey
.zInterWithScores
(byte[]... sets) Intersect sortedsets
.zInterWithScores
(Aggregate aggregate, int[] weights, byte[]... sets) Intersect sortedsets
.zInterWithScores
(Aggregate aggregate, Weights weights, byte[]... sets) Intersect sortedsets
.zLexCount
(byte[] key, org.springframework.data.domain.Range<byte[]> range) Count number of elements within sorted set with value betweenRange#min
andRange#max
applying lexicographical ordering.zMScore
(byte[] key, byte[]... values) Get the scores of elements withvalues
from sorted set with keykey
.zPopMax
(byte[] key) Remove and return the value with its score having the highest score from sorted set atkey
.zPopMax
(byte[] key, long count) Remove and returncount
values with their score having the highest score from sorted set atkey
.zPopMin
(byte[] key) Remove and return the value with its score having the lowest score from sorted set atkey
.zPopMin
(byte[] key, long count) Remove and returncount
values with their score having the lowest score from sorted set atkey
.byte[]
zRandMember
(byte[] key) Get random element from sorted set atkey
.List<byte[]>
zRandMember
(byte[] key, long count) Getcount
random elements from sorted set atkey
.zRandMemberWithScore
(byte[] key) Get random element from sorted set atkey
.zRandMemberWithScore
(byte[] key, long count) Getcount
random elements from sorted set atkey
.Set<byte[]>
zRange
(byte[] key, long start, long end) Get elements betweenstart
andend
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, org.springframework.data.domain.Range<byte[]> range) Get all the elements inRange
from the sorted set at key in lexicographical ordering.Set<byte[]>
zRangeByLex
(byte[] key, org.springframework.data.domain.Range<byte[]> range, Limit limit) Get all the elements inRange
from the sorted set at key in lexicographical ordering.default Set<byte[]>
zRangeByScore
(byte[] key, double min, double max) Get elements where score is betweenmin
andmax
from sorted set.default Set<byte[]>
zRangeByScore
(byte[] 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[]>
zRangeByScore
(byte[] key, String min, String max) Deprecated.since 3.0, usezRangeByScore(byte[], org.springframework.data.domain.Range)
instead.Set<byte[]>
zRangeByScore
(byte[] key, String min, String max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.default Set<byte[]>
zRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Get elements where score is betweenRange#min
andRange#max
from sorted set.Set<byte[]>
zRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Get elements in range fromLimit#count
toLimit#offset
where score is betweenRange#min
andRange#max
from sorted set.zRangeByScoreWithScores
(byte[] key, double min, double max) zRangeByScoreWithScores
(byte[] key, double min, double max, long offset, long count) zRangeByScoreWithScores
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) zRangeByScoreWithScores
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, 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[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<byte[]> range) This command is like ZRANGE , but stores the result in the dstKey destination key.zRangeStoreByLex
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.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, org.springframework.data.domain.Range<? extends Number> range) This command is like ZRANGE, but stores the result in the dstKey destination key.zRangeStoreByScore
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.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, org.springframework.data.domain.Range<byte[]> range) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.zRangeStoreRevByLex
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.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, org.springframework.data.domain.Range<? extends Number> range) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.zRangeStoreRevByScore
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.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) zRank
(byte[] key, byte[] value) Determine the index of element withvalue
in a sorted set.zRem
(byte[] key, byte[]... values) Removevalues
from sorted set.zRemRange
(byte[] key, long start, long end) Remove elements in range betweenstart
andend
from sorted set withkey
.zRemRangeByLex
(byte[] key, org.springframework.data.domain.Range<byte[]> range) Remove all elements between the lexicographicalRange
.default Long
zRemRangeByScore
(byte[] key, double min, double max) Remove elements with scores betweenmin
andmax
from sorted set withkey
.zRemRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Remove elements with scores betweenRange#min
andRange#max
from sorted set withkey
.Set<byte[]>
zRevRange
(byte[] key, long start, long end) Get elements in range fromstart
toend
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, org.springframework.data.domain.Range<byte[]> range) Get all the elements inRange
from the sorted set at key in reversed lexicographical ordering.Set<byte[]>
zRevRangeByLex
(byte[] key, org.springframework.data.domain.Range<byte[]> range, Limit limit) Get all the elements inRange
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 betweenmin
andmax
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 fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.default Set<byte[]>
zRevRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Get elements where score is betweenRange#min
andRange#max
from sorted set ordered from high to low.Set<byte[]>
zRevRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, 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[] key, double min, double max) zRevRangeByScoreWithScores
(byte[] 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[] key, org.springframework.data.domain.Range<? extends Number> range) Get set ofTuple
where score is betweenRange#min
andRange#max
from sorted set ordered from high to low.zRevRangeByScoreWithScores
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, 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[] key, long start, long end) zRevRank
(byte[] key, byte[] value) Determine the index of element withvalue
in a sorted set when scored high to low.zScan
(byte[] key, ScanOptions options) Use aCursor
to iterate over elements in sorted set atkey
.zScore
(byte[] key, byte[] value) Get the score of element withvalue
from sorted set with keykey
.Set<byte[]>
zUnion
(byte[]... sets) Union sortedsets
.zUnionStore
(byte[] destKey, byte[]... sets) Union sortedsets
.default Long
zUnionStore
(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Union sortedsets
and store result in destinationdestKey
.zUnionStore
(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) Union sortedsets
and store result in destinationdestKey
.zUnionWithScores
(byte[]... sets) Union sortedsets
.zUnionWithScores
(Aggregate aggregate, int[] weights, byte[]... sets) Union sortedsets
.zUnionWithScores
(Aggregate aggregate, Weights weights, byte[]... 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
- 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
- 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
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
@Nullable default Set<Tuple> zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends 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
@Nullable default Set<byte[]> zRangeByScore(byte[] 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
@Nullable default Set<Tuple> zRangeByScoreWithScores(byte[] 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
@Nullable Set<Tuple> zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends Number> range, 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
@Nullable default Set<byte[]> zRevRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends 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
- 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 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
@Nullable Set<byte[]> zRevRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range, 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
@Nullable default Set<Tuple> zRevRangeByScoreWithScores(byte[] 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
@Nullable default Set<Tuple> zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends 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
@Nullable Set<Tuple> zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends Number> range, 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
@Nullable Long zRemRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range) 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
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
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
@Nullable default Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... 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
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
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
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
@Nullable default Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... 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
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.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
@Nullable default Set<byte[]> zRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends 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
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
@Nullable Set<byte[]> zRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range, 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
@Nullable default Set<byte[]> zRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> 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
@Nullable Set<byte[]> zRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> range, 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
@Nullable default Set<byte[]> zRevRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> 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
@Nullable Set<byte[]> zRevRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> range, 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
@Nullable default Long zRangeStoreByLex(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.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, org.springframework.data.domain.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, org.springframework.data.domain.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, org.springframework.data.domain.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, org.springframework.data.domain.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, org.springframework.data.domain.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, org.springframework.data.domain.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, org.springframework.data.domain.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:
-
Limit
instead.