hstrlen.3valkey - Man Page

Returns the length of the value of a field.

Synopsis

HSTRLEN key field

Description

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.

Reply

valkey-protocol(7) 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.

Complexity

O(1)

Acl Categories

@fast @hash @read

History

Examples

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

See Also

hdel(3valkey), hexists(3valkey), hget(3valkey), hgetall(3valkey), hincrby(3valkey), hincrbyfloat(3valkey), hkeys(3valkey), hlen(3valkey), hmget(3valkey), hrandfield(3valkey), hscan(3valkey), hset(3valkey), hsetnx(3valkey), hvals(3valkey)

Info

2024-09-23 8.0.0 Valkey Command Manual