HSTRLEN

Syntax

  1. HSTRLEN key field

Time complexity: O(1)

Returns the string length of the value associated with field in the hash stored at key. If the key or the field do not exist, 0 is returned.

Return

Integer reply: the string length of the value associated with field, or zero when field is not present in the hash or key does not exist at all.

Examples

  1. dragonfly> HMSET myhash f1 HelloWorld f2 99 f3 -256
  2. "OK"
  3. dragonfly> HSTRLEN myhash f1
  4. (integer) 10
  5. dragonfly> HSTRLEN myhash f2
  6. (integer) 2
  7. dragonfly> HSTRLEN myhash f3
  8. (integer) 4