ZPOPMIN
Syntax
Section titled “Syntax”ZPOPMIN key [count]
ZPOPMIN removes and returns the member with the lowest score from the sorted set at the specified key.
If the key does not exist, the command returns empty list. An optional “count” argument can be provided to remove and return multiple members (up to the number specified).
When popped, the elements are returned in ascending order of score and you get the rank of the element in the sorted set. The rank is 1-based, which means that the first element is at rank 1 and not rank 0. The 1), 2), 3), … is the rank of the element in the sorted set.
Examples
Section titled “Examples”localhost:7379> ZADD users 10 alice 20 bob 30 charlieOK 3localhost:7379> ZPOPMIN usersOK1) 10, alicelocalhost:7379> ZPOPMIN users 10OK1) 20, bob2) 30, charlie