Easy Tutorial
❮ Sorted Sets Zscore Server Info ❯

Redis Llen Command

Redis Lists

The Redis Llen command is used to return the length of a list.

If the list key does not exist, the key is interpreted as an empty list and returns 0.

If the key is not of the list type, an error is returned.

Syntax

The basic syntax of the redis Llen command is as follows:

redis 127.0.0.1:6379> LLEN KEY_NAME

Available Versions

= 1.0.0

Return Value

The length of the list.

Example

redis 127.0.0.1:6379> RPUSH list1 "foo"
(integer) 1
redis 127.0.0.1:6379> RPUSH list1 "bar"
(integer) 2
redis 127.0.0.1:6379> LLEN list1
(integer) 2

Redis Lists

❮ Sorted Sets Zscore Server Info ❯