= 2.0.0 " />
English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis Hlen command is used to get the number of fields in the hash table.
The basic syntax of the redis Hlen command is as follows:
redis 127.0.0.1:6379> HLEN KEY_NAME
>= 2.0.0
The number of fields in the hash table. Returns 0 when the key does not exist.
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