Handles Redis hash commands: HSET, HGET, HDEL, HMGET, HGETALL, HLEN, HEXISTS, HKEYS, HVALS, HSETNX, HINCRBY, HINCRBYFLOAT, HEXPIRE, HTTL, HPERSIST, HSCAN, HRANDFIELD.
Each hash field is stored as an individual compound key entry in the shared shard Bitcask:
H:redis_key\0field_name -> valueThis allows individual field access without reading or deserializing the entire hash. HGETALL scans all entries matching the hash prefix.
Hash Field TTL (Redis 7.4+)
Individual hash fields can have per-field expiry via HEXPIRE, HTTL,
and HPERSIST. The expiry is stored as the expire_at_ms timestamp on
each compound key entry.
Type Enforcement
All hash commands check the type metadata for the key. If the key already exists as a different data type (list, set, zset), a WRONGTYPE error is returned.
Summary
Functions
Handles a hash command.