1. Zadd
Format: Zadd ' name ' {num} ' value '
Add value to the sorted set named name. Num is the ordinal value of the element, and if the added num already exists, it does not overwrite the original value, and there will be two different values for the same num. However, a new num value can be given to a value that already exists.
2. Zrange
Format: Zrange ' name ' {NUM1} {num2} [Withscores]
Get the element named name of sorted set inside {NUM1} to {num2} subscript. The withscores will output the sequence number.
3. Zrangebyscore
Format: Zrangebyscore ' name ' {NUM1} {num2} [Withscores]
Get the element named name of the sorted set inside {NUM1} to {num2} sequence number (not subscript). The withscores will output the sequence number.
4. Zrem
Format: Zrem ' name ' ' value '
The value is removed from the sorted set named name.
5. Zincrby
Format: zincrby±{num} ' name ' ' value '
Let the order number of value increment by num, and if value does not exist, add value to sorted set with NUM for the order number. If NUM is negative, it is reduced.
6. Zrank
Format: Zrank ' name ' ' value '
Sorts the sorted set named name first in ascending order, and then returns the subscript for the sorted value.
7. Zrevrank
Format: Zrevrank ' name ' ' value '
Sorts the sorted set named name first in descending order, and then returns the subscript for the sorted value.
8. Zcount
Format: Zcount ' name ' {NUM1} {num2}
Gets the number of elements in the sorted set named name {NUM1} to {num2} sequence number (not subscript).
9. Zcard
Format: Zcard ' name '
Returns the number of elements in the sorted set named name.
Ten. Zremrangebyrank
Format: Zremrangebyrank ' name ' {NUM1} {num2} [Withscores]
Sort the sorted set named name first in ascending order, and then remove the value of the subscript {NUM1} to {num2}.
This article is from the "Bronze Gong" blog, please be sure to keep this source http://jaeger.blog.51cto.com/11064196/1772276
Redis data type operation (v)--sorted Set