Lists Blpop
# Redis Blpop Command
[!(#) Redis Lists](#)
The Redis Blpop command removes and gets the first element from a list. If the list does not exist, it blocks the list until a timeout is reached or an element is found to pop.
### Syntax
The basic syntax for the Redis Blpop command is as follows:
redis 127.0.0.1:6379> BLPOP LIST1 LIST2 .. LISTN TIMEOUT
### Available Since
>= 2.0.0
### Return Value
If the list is empty, it returns a nil. Otherwise, it returns a list containing two elements: the first element is the key of the popped element, and the second element is the value of the popped element.
### Example
redis 127.0.0.1:6379> BLPOP list1 100
In the above example, the operation will be blocked. If the specified list key `list1` contains data, it will return the first element. Otherwise, it will return nil after waiting for 100 seconds.
(nil)(100.06s)
[!(#) Redis Lists](#)
YouTip