Latest web development tutorials

Redis Llen command

Redis list (List)

Redis Llen command returns the length of the list. If the list key is not present, then the key is interpreted as an empty list, return 0. If the key is not the type of list, an error is returned.

grammar

redis Llen basic command syntax is as follows:

redis 127.0.0.1:6379> LLEN KEY_NAME 

Available versions

> = 1.0.0

return value

Length of the list.

Examples

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 list (List)