9951 explained code solutions for 126 technologies


python-redisRedis zadd example - adds element to sorted set


r = redis.Redis()
r.zadd('top', {'Donald': 2})ctrl + c
redis.Redis

connect to Redis server

zadd

adds element(s) to the specified sorted set

Donald

name of the element

2

score of the element to add

top

name of the sorted set in Redis to add element to