English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis LLEN command is used to return the length of the list. If the list key does not exist, the key is interpreted as an empty list and returns 0. If the key is not a list type, an error is returned.
Basic Syntax of Redis LLEN Command:
redis 127.0.0.1:6379> LLEN KEY_NAME
>= 1.0.0
List Length.
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