列表操作 List

BLPOP key [key ...] timeout
Remove and get the first element in a list, or block until one is available

BRPOP key [key ...] timeout
Remove and get the last element in a list, or block until one is available

BRPOPLPUSH source destination timeout
Pop an element from a list, push it to another list and return it; or block until one is available

BLMOVE source destination LEFT|RIGHT LEFT|RIGHT timeout
Pop an element from a list, push it to another list and return it; or block until one is available

LINDEX key index
Get an element from a list by its index

LINSERT key BEFORE|AFTER pivot element
Insert an element before or after another element in a list

LLEN key
Get the length of a list

LPOP key
Remove and get the first element in a list

LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len]
Return the index of matching elements on a list

LPUSH key element [element ...]
Prepend one or multiple elements to a list

LPUSHX key element [element ...]
Prepend an element to a list, only if the list exists

LRANGE key start stop
Get a range of elements from a list

LREM key count element
Remove elements from a list

LSET key index element
Set the value of an element in a list by its index

LTRIM key start stop
Trim a list to the specified range

RPOP key
Remove and get the last element in a list

RPOPLPUSH source destination
Remove the last element in a list, prepend it to another list and return it

LMOVE source destination LEFT|RIGHT LEFT|RIGHT
Pop an element from a list, push it to another list and return it

RPUSH key element [element ...]
Append one or multiple elements to a list

RPUSHX key element [element ...]
Append an element to a list, only if the list exists

powered by Gitbook© 2023 编外计划 | 最后修改: 2023-11-24 03:36:59

results matching ""

    No results matching ""