BZMPOP

Removes a batch of lowest-score members with a waiting timeout.

Sorted sets · Example verified

Syntax covered here

BZMPOP timeout-seconds numkeys key MIN COUNT count

The case supplies one sorted set and retrieves two members in ascending score order; a missing key times out with null.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> ZADD scores 1 a 2 b
2
# connection: default
> BZMPOP 0.1 1 scores MIN COUNT 2
["scores",[["a","1"],["b","2"]]]
# connection: default
> BZMPOP 0.1 1 missing-zset MIN COUNT 2
null