The previous one has already told a part of the order of the ordered collection type.
http://blog.csdn.net/wtyvhreal/article/details/42804571
Third, command supplements
1. Get the number of elements in the collection
Zcard Key
2. Get the number of elements in the specified score range
<span style= "FONT-SIZE:14PX;" >zcount Key min max</span>
3. Delete one or more elements
<span style= "FONT-SIZE:14PX;" >zrem Key member</span>
The return value is the number of elements that were successfully deleted (does not contain elements that would not otherwise exist)
4. Delete Elements by rank range
Zremrangebyrank Key Start stop
Deletes all elements in the specified rank range from small to large order (0), and returns the number of deleted elements.
5. Deleting elements by fractional range
Zremrangebyscore Key min Max
The return value is the number of deleted elements
Delete the E with a score of 5, leaving D and F.
6. Get the ranking of the elements
Zrank Key Memberzrevrank Key member
Gets the rank of the specified element in the order of the element fraction from small to large (starting at 0).
7. Calculating the intersection of ordered sets
Used to calculate the intersection of multiple ordered sets and store the results in the destination key (also stored as an ordered collection type), the return value is the number of elements in the destination key.
The fraction of the elements in the destination key is determined by the aggregate parameter.
(1) when when aggregate is sum (the default), the fraction of the element in the destination key is the sum of the fraction of that element in each participating collection.
(2) When Aggregate is min, the fraction of the element in the destination key is the minimum value of each fraction of the set element that participates in the calculation
(3) When aggregate is Max, the element fraction in the destination key is the maximum value of the element fraction in each participating collection
The Zinterstore command sets the weight of each collection through the weights parameter, and the fraction of the element is multiplied by the weight of the collection each time the collection participates in the calculation.
2=1+10*0.1
4=2+20*0.1
There is also an imperative zunionstore, which is to compute a set of aggregates between sets.
Redis Research (ix)-ordered set type 2