HLEN
HLEN key
- Available since:
- Redis Open Source 2.0.0
- Time complexity:
- O(1)
- ACL categories:
-
@read,@hash,@fast, - Compatibility:
- Redis Software and Redis Cloud compatibility
Returns the number of fields contained in the hash stored at key.
Required arguments
key
The name of the key that holds the hash.
Examples
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
Integer reply: the number of fields in the hash, or 0 when the key does not exist.