| Zadd (name, args, *kwargs) |
Add the element Member,score to the zset of the key name for sorting. If the element exists, its order is updated |
Redis.zadd (' grade ', +, ' Bob ', 98, ' Mike ') |
2, that is, the number of elements added |
| Zrem (name, *values) |
Remove the element from the Zset key for name |
Redis.zrem (' Grade ', ' Mike ') |
1, that is, the number of deleted elements |
| Zincrby (name, value, amount=1) |
If the element value already exists in the Zset of key name, the score of the element is incremented amount, otherwise the element is added to the collection, and its score value is amount |
Redis.zincrby (' Grade ', ' Bob ',-2) |
98.0, which is the modified value |
| Zrank (name, value) |
Returns the rank of the element in the Zset key for name (sorted by score from small to large) that is subscript |
Redis.zrank (' Grade ', ' Amy ') |
1 |
| Zrevrank (name, value) |
Returns the inverse rank of the element in the Zset of key name (sorted by score from large to small) that is subscript |
Redis.zrevrank (' Grade ', ' Amy ') |
2 |
| Zrevrange (name, start, end, Withscores=false) |
Returns all elements of index from start to end in the Zset of key name (sorted by score from large to small) |
Redis.zrevrange (' Grade ', 0, 3) |
[B ' Bob ', b ' Mike ', b ' Amy ', B ' James '] |
| Zrangebyscore (name, Min, Max, Start=none, Num=none, Withscores=false) |
Returns the element score a given interval in the Zset key for name |
Redis.zrangebyscore (' Grade ', 80, 95) |
[B ' Amy ', B ' James '] |
| Zcount (name, Min, max) |
Returns the number of score in a given interval in the zset of the key name |
Redis.zcount (' Grade ', 80, 95) |
2 |
| Zcard (name) |
Returns the number of elements of the Zset key for name |
Redis.zcard (' Grade ') |
3 |
| Zremrangebyrank (name, Min, max) |
Removes the element that is ranked in the given interval in the Zset key for name |
Redis.zremrangebyrank (' Grade ', 0, 0) |
1, that is, the number of deleted elements |
| Zremrangebyscore (name, Min, max) |
Delete the element in the given interval in the Zset of key name score |
Redis.zremrangebyscore (' Grade ', 80, 90) |
1, that is, the number of deleted elements |