HSTRLEN

This page documents the preview (v2.21) version. Preview includes features under active development and is for development and testing only. For production, use the stable (v2024.1) version.

Synopsis

HSTRLEN key field

This command seeks the length of a string value that is associated with the given field in a hash table that is associated with the given key.

  • If the key or field does not exist, 0 is returned.
  • If the key is associated with a non-hash-table value, an error is raised.

Return value

Returns the length of the specified string.

Examples

$ HMSET yugahash L1 America L2 Europe
"OK"
$ HSTRLEN yugahash L1
7

See also

hdel, hexists, hget, hgetall, hkeys, hlen, hmget, hmset, hset, hincrby, hvals