HLEN

Since 1.1.0Hashes

Syntax

HLEN key
  • Flags: fast, readonly
  • ACL categories: @fast, @hash, @read
  • Arity: 2

Returns the number of fields in the hash at key.

Reply

  • The count; 0 if the key does not exist.

Examples

> HSET u name Ada lang Rust
(integer) 2
> HLEN u
(integer) 2