Returns the length of the value of a field.
HSTRLEN
key field
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.
Integer reply: the string length of the value associated with the field, or zero when the field isn’t present in the hash or the key doesn’t exist at all.
O(1)
@fast @hash @read
127.0.0.1:6379> HSET myhash f1 HelloWorld f2 99 f3 -256
(integer) 3
127.0.0.1:6379> HSTRLEN myhash f1
(integer) 10
127.0.0.1:6379> HSTRLEN myhash f2
(integer) 2
127.0.0.1:6379> HSTRLEN myhash f3
(integer) 4
HDEL, HEXISTS, HGET, HGETALL, HINCRBY, HINCRBYFLOAT, HKEYS, HLEN, HMGET, HRANDFIELD, HSCAN, HSET, HSETNX, HVALS.