ZPOPMIN key [count]
Removes and returns up to count
members with the lowest scores in the sorted set stored at key
.
When left unspecified, the default value for count
is 1. Specifying a count
value that is higher than the sorted set's cardinality will not produce an error. When returning multiple elements, the one with the lowest score will be the first, followed by the elements with greater scores.
Array reply: list of popped elements and scores.
(integer) 1
redis> ZADD myzset 2 "two" (integer) 1
redis> ZADD myzset 3 "three" (integer) 1
redis> ZPOPMIN myzset 1) "1"
2) "one"
© 2009–2018 Salvatore Sanfilippo
Licensed under the Creative Commons Attribution-ShareAlike License 4.0.
https://redis.io/commands/zpopmin