9951 explained code solutions for 126 technologies


python-redisGet all element from sorted set in Redis


r = redis.Redis()
list = r.zrange('top', 0, -1)ctrl + c
redis.Redis

connect to Redis server

zrange

retrieves sorted set elements based on offset and limit

top

name of sorted set in Redis

0, -1

will return all elements from sorted set

list

resulting list with elements from sorted set