LMPOP
Since 1.1.0Lists
Syntax
LMPOP numkeys key [key ...] LEFT|RIGHT [COUNT count]Pops elements from the first of the given lists that is not empty. numkeys is how many keys follow.
Options
| Option | Effect |
|---|---|
LEFT, RIGHT | Pop from the head or the tail. |
COUNT count | Pop up to count elements (1 by default). |
Reply
- A two-element array: the key popped from, and the elements.
nilif every list is empty.
Examples
> RPUSH q2 x y z
(integer) 3
> LMPOP 2 q1 q2 LEFT
1) "q2"
2) 1) "x"
> LMPOP 2 q1 q2 RIGHT COUNT 5
1) "q2"
2) 1) "z"
2) "y"