Get all participants in the Sorted Set

I have a sorted set and want to get all the elements of the set. How to determine the maximum / minimum score for a team:

zrange key min max 

?

+44
redis
Jul 16 '12 at 12:17
source share
1 answer

You are lucky because zrange does not take ratings, but indices. 0 is the first index, and -1 will be interpreted as the last index:

 zrange key 0 -1 

To get the range of scores, you would instead call zrangebyscore - where -inf and +inf can be used to denote negative and positive infinity, respectively, as Didier La Spezia notes in his comment:

 zrangebyscore key -inf +inf 
+72
Jul 16 2018-12-12T00:
source share



All Articles