ZPOPMIN

ZPOPMIN key [count]
Available since:
Redis Open Source 5.0.0
Time complexity:
O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.
ACL categories:
@write, @sortedset, @fast,
Compatibility:
Redis Software and Redis Cloud compatibility

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.

Required arguments

key

The name of the key that holds the sorted set.

Optional arguments

count

The number of members to pop. Without it, a single member is popped.

Examples

ZADD myzset 1 "one" ZADD myzset 2 "two" ZADD myzset 3 "three" ZPOPMIN myzset

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
✅ Standard
✅ Active-Active
✅ Standard
✅ Active-Active

Return information

RATE THIS PAGE
Back to top ↑