content/commands/hlen.md
Returns the number of fields contained in the hash stored at key.
{{% redis-cli %}} HSET myhash field1 "Hello" HSET myhash field2 "World" HLEN myhash {{% /redis-cli %}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="hlen-return-info" tab1="RESP2" tab2="RESP3" >}}
Integer reply: the number of fields in the hash, or 0 when the key does not exist.
-tab-sep-
Integer reply: the number of the fields in the hash, or 0 when the key does not exist.
{{< /multitabs >}}