Returns the length of a list.
LLEN
key
Returns the length of the list stored at key
. If
key
does not exist, it is interpreted as an empty list and
0
is returned. An error is returned when the value stored
at key
is not a list.
Integer reply: the length of the list.
O(1)
@fast @list @read
127.0.0.1:6379> LPUSH mylist "World"
(integer) 1
127.0.0.1:6379> LPUSH mylist "Hello"
(integer) 2
127.0.0.1:6379> LLEN mylist
(integer) 2
BLMOVE, BLMPOP, BLPOP, BRPOP, LINDEX, LINSERT, LMOVE, LMPOP, LPOP, LPOS, LPUSH, LPUSHX, LRANGE, LREM, LSET, LTRIM, RPOP, RPUSH, RPUSHX.