SPOP
Since 1.1.0Sets
Syntax
SPOP key [count]Removes and returns members of the set at key, picked at random. A set left empty is deleted.
Reply
- Without
count: a member, ornilif the key does not exist. - With
count: an array of up tocountmembers; empty if the key does not exist.
Examples
> SADD s a b c
(integer) 3
> SPOP s
"c"
> SPOP s 5
1) "b"
2) "a"
> EXISTS s
(integer) 0