BZPOPMIN
Note
Official reference: BZPOPMIN.
Wait and pop the lowest-scoring member from the first nonempty sorted set.
Syntax
BZPOPMIN key [key ...] timeout
timeout is in seconds. Use a nonnegative integer literal; 0 waits indefinitely.
Results
| Return | Rows | Content |
|---|---|---|
| ResultSet | 1 | KEY field, STRING type ELEMENT field, STRING type SCORE field, DOUBLE type |
Caution
When all source sets are empty (or a blocking call times out), the current driver can fail rather than reliably return an empty ResultSet. Use a Redis client when this case must be handled.
Example
ZADD demo:ranking 10 alice 20 bob
BZPOPMIN demo:ranking 1