Latest web development tutorials

comando Redis Hlen

Redis de hash (hash)

Redis comando Hlen é usado para obter o número de campos na tabela hash.

gramática

Redis Hlen sintaxe de comando básica é a seguinte:

redis 127.0.0.1:6379> HLEN KEY_NAME 

versões disponíveis

> = 2.0.0

Valor de retorno

O número de campos na tabela hash. Quando a chave não existe, 0 é retornado.

Exemplos

redis 127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
redis 127.0.0.1:6379> HSET myhash field2 "bar"
(integer) 1
redis 127.0.0.1:6379> HLEN myhash
(integer) 2

Redis de hash (hash)