Command |
Explain |
lpush key string |
in the key corresponding to the list's header Add string element, return 1 for success, 0 means that key exists and is not a list type. |
rpush key string |
Ibid., end insert. |
llen key |
Returns the length of the key corresponding to the list, key does not exist return 0 if the key corresponding type is not a list return error. |
lrange key start end |
Returns the element within the specified interval, the subscript starts at 0, the negative value is calculated from the back, 1 is the first element of the countdown, Key does not exist returns an empty list. |
LTrim key start end |
intercept list, keep elements within specified interval, successfully return 1,key there is no return error. |
lset key index value |
Sets the value of the element specified in the list, returns 1,key successfully or the subscript does not have a return error. |
lrem key count value |
|
lpop key |
|
rpop key |
Ibid. Tail delete. |
blpop Key1...keyn Timeout |
left-to-right scan returns a LPOP operation on the first non-empty list and returns, such as Blpop List1 List2 List3 0, if the list does not exist, LIST2,LIST3 is non-null to List2 Lpop and returns the element removed from the List2. If all the lists are empty or nonexistent, the timeout second is blocked, and a timeout of 0 means that it is blocked. |
brpop |
with Blpop, one to remove from the head is to remove from the tail |
rpoplpush Srckey Destkey |
Remove the element from the tail of the Srckey corresponding list and add it to the header of the destkey corresponding list. Finally, the value of the removed element is returned, and the entire operation is atomic. If Srckey is empty |
LINDEX key index |
Returns the element in the list key labeled Index. You can also use a negative subscript, 1 for the last element of the list, 2 for the penultimate element of the list, and so on. |
Linsert Key before| After pivot value |
Inserts a value in the list key, either before or after the value pivot. When pivot does not exist in the list key, no action is taken. When key does not exist, key is treated as an empty list, and no action is taken. If key is not a list type, an error is returned. |