Adds one or more members to a sorted set, or update its score if it already exists.
Adds one or more members to a sorted set, or update its score if it already exists.
sorted set key
member-score pair to be added
additional member-score pairs to be added (adding several members at once only works with Redis >= 2.4)
the number of elements added to the sorted sets, not including elements already existing for which the score was updated
1.2.0
if key contains a value that is not a sorted set
If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering.
Adds one or more members to a sorted set, or update its score if it already exists.
Adds one or more members to a sorted set, or update its score if it already exists.
sorted set key
member-score pairs to be added (adding several members at once only works with Redis >= 2.4)
the number of elements added to the sorted sets, not including elements already existing for which the score was updated
1.2.0
if memberScoreMap is empty or key contains a value that is not a sorted set
If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering.
Returns the number of members in a sorted set.
Returns the number of members in a sorted set.
sorted set key
the cardinality (number of elements) of the sorted set, or 0 if key does not exist
1.2.0
if key contains a value that is not a sorted set
Returns the number of elements of a sorted set belonging to a given score range.
Returns the number of elements of a sorted set belonging to a given score range.
sorted set key
score lower bound
score upper bound
the number of elements in the specified score range
2.0.0
if key contains a value that is not a sorted set
Increments the score of a member in a sorted set.
Increments the score of a member in a sorted set.
sorted set key
member whose score needs to be incremented
the increment
the new score of member
1.2.0
if key contains a value that is not a sorted set
Intersects multiple sorted sets and stores the resulting sorted set in a new key.
Intersects multiple sorted sets and stores the resulting sorted set in a new key.
sorted set key
aggregation function (default is Sum)
key of first sorted set
additional keys of sorted sets
the number of elements in the resulting sorted set stored at destKey
2.0.0
if key contains a value that is not a sorted set
Intersects multiple sorted sets and stores the resulting sorted set in a new key.
Intersects multiple sorted sets and stores the resulting sorted set in a new key.
sorted set key
aggregation function (default is Sum)
first sorted set key to weight pair
additional sorted set key to weight pairs
the number of elements in the resulting sorted set stored at destKey
2.0.0
if key contains a value that is not a sorted set
Returns a range of members in a sorted set, by index.
Returns a range of members in a sorted set, by index.
sorted set key
start offset (inclusive)
end offset (inclusive)
the set of ascendingly ordered elements in the specified range, or the empty set if key does not exist
1.2.0
if key contains a value that is not a sorted set
Both start and stop are zero-based indexes, where 0 is the first element, 1 is the next
element and so on. They can also be negative numbers indicating offsets from the end of the
sorted set, with -1 being the last element of the sorted set, -2 the penultimate element and
so on. Out of range indexes will not produce an error. If start is larger than the largest
index in the sorted set, or start
> end
, an empty list is returned. If end
is larger
than the end of the sorted set Redis will treat it like it is the last element of the
sorted set. The indexes are inclusive.
Returns a range of members in a sorted set, by score.
Returns a range of members in a sorted set, by score.
sorted set key
score lower bound
score upper bound
optional offset and count pair used to limit the number of matching elements
the set of ascendingly ordered elements in the specified score range, or the empty set if key does not exist
2.2.0
if key contains a value that is not a sorted set
The elements having the same score are returned in lexicographical order (this follows from a property of the sorted set implementation in Redis and does not involve further computation).
Returns a range of members with associated scores in a sorted set, by score.
Returns a range of members with associated scores in a sorted set, by score.
sorted set key
score lower bound
score upper bound
optional offset and count pair used to limit the number of matching elements
the set of ascendingly ordered element-score pairs in the specified score range, or the empty set if key does not exist
2.0.0
if key contains a value that is not a sorted set
The elements having the same score are returned in lexicographical order (this follows from a property of the sorted set implementation in Redis and does not involve further computation).
Returns a range of members with associated scores in a sorted set, by index.
Returns a range of members with associated scores in a sorted set, by index.
sorted set key
start offset (inclusive)
end offset (inclusive)
the set of ascendingly ordered elements-score pairs in the specified range, or the empty set if key does not exist
1.2.0
if key contains a value that is not a sorted set
Both start and stop are zero-based indexes, where 0 is the first element, 1 is the next
element and so on. They can also be negative numbers indicating offsets from the end of the
sorted set, with -1 being the last element of the sorted set, -2 the penultimate element and
so on. Out of range indexes will not produce an error. If start is larger than the largest
index in the sorted set, or start
> end
, an empty list is returned. If end
is larger
than the end of the sorted set Redis will treat it like it is the last element of the
sorted set. The indexes are inclusive.
Determines the index of a member in a sorted set.
Determines the index of a member in a sorted set.
sorted set key
the value
the rank or index of the member, or None
if the member is not in the set or the key
does not exist
2.0.0
if key contains a value that is not a sorted set
Removes one or more members from a sorted set.
Removes one or more members from a sorted set.
sorted set key
the value to be removed
additional values to be removed (only works with Redis >= 2.4)
the number of members removed from the sorted set, not including non existing members
2.0.0
if key contains a value that is not a sorted set
Redis versions older than 2.4 can only remove one value per call.
Removes all members in a sorted set within the given indexes.
Removes all members in a sorted set within the given indexes.
sorted set key
the start offset or index (inclusive)
the end offset or index (inclusive)
the number of members removed
2.0.0
if key contains a value that is not a sorted set
Both start and stop are zero-based inclusive indexes with 0 being the element with the lowest score. These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score. For example: -1 is the element with the highest score, -2 the element with the second highest score and so forth.
Removes all members in a sorted set within the given scores range.
Removes all members in a sorted set within the given scores range.
sorted set key
score lower bound
score upper bound
the number of members removed
1.2.0
if key contains a value that is not a sorted set
Since version 2.1.6, min and max can be exclusive, following the syntax of ZRANGEBYSCORE.
Returns a range of members in a sorted set, by index, with scores ordered from high to low.
Returns a range of members in a sorted set, by index, with scores ordered from high to low.
sorted set key
start offset (inclusive)
end offset (inclusive)
the set of descendingly ordered elements in the specified range, or the empty set if key does not exist
1.2.0
if key contains a value that is not a sorted set
Apart from the reversed ordering, ZREVRANGE is similar to ZRANGE.
Returns a range of members in a sorted set, by score, with scores ordered from high to low.
Returns a range of members in a sorted set, by score, with scores ordered from high to low.
sorted set key
score upper bound
score lower bound
optional offset and count pair used to limit the number of matching elements
the set of descendingly ordered elements in the specified score range, or the empty set if key does not exist
2.2.0
if key contains a value that is not a sorted set
Apart from the reversed ordering, ZREVRANGEBYSCORE is similar to ZRANGEBYSCORE.
Return a range of members with associated scores in a sorted set, by score, with scores ordered from high to low.
Return a range of members with associated scores in a sorted set, by score, with scores ordered from high to low.
sorted set key
score upper bound
score lower bound
optional offset and count pair used to limit the number of matching elements
the set of descendingly ordered elements in the specified score range, or the empty set if key does not exist
2.0.0
if key contains a value that is not a sorted set
Apart from the reversed ordering, ZREVRANGEBYSCORE is similar to ZRANGEBYSCORE.
Returns a range of members in a sorted set, by index, with scores ordered from high to low.
Returns a range of members in a sorted set, by index, with scores ordered from high to low.
sorted set key
start offset (inclusive)
end offset (inclusive)
the set of descendingly ordered elements-score pairs in the specified range, or the empty set if key does not exist
1.2.0
if key contains a value that is not a sorted set
Apart from the reversed ordering, ZREVRANGE is similar to ZRANGE.
Determine the index of a member in a sorted set, with scores ordered from high to low.
Determine the index of a member in a sorted set, with scores ordered from high to low.
sorted set key
the value
the rank or index of the member, or None
if the member is not in the set or the key
does not exist
2.0.0
if key contains a value that is not a sorted set
Incrementally iterates the elements (value-score pairs) of a sorted set.
Incrementally iterates the elements (value-score pairs) of a sorted set.
the offset
when defined, provides a hint of how many elements should be returned
when defined, the command only returns elements matching the pattern
a pair containing the next cursor as its first element and the sorted set of elements (value-score pairs) as its second element
2.8.0
Returns the score associated with the given member in a sorted set.
Returns the score associated with the given member in a sorted set.
sorted set key
the value
the score of member, or None
if the latter is not in the sorted set or the key does
not exist
1.2.0
if key contains a value that is not a sorted set
Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.
Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.
sorted set key
aggregation function (default is Sum)
key of first sorted set
additional keys of sorted sets
the number of elements in the resulting sorted set stored at destKey
2.0.0
if key contains a value that is not a sorted set
Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.
Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.
sorted set key
aggregation function (default is Sum)
first sorted set key to weight pair
additional sorted set key to weight pairs
the number of elements in the resulting sorted set stored at destKey
2.0.0
if key contains a value that is not a sorted set
This trait implements sorted sets commands.