LLEN

Syntax

1. LLEN key

Time complexity: O(1)

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.

Return

Integer reply: the length of the list at key.

Examples

1. dragonfly> LPUSH mylist "World"
2. (integer) 1
3. dragonfly> LPUSH mylist "Hello"
4. (integer) 2
5. dragonfly> LLEN mylist
6. (integer) 2