HINCRBY
Since 1.1.0Hashes
Syntax
HINCRBY key field incrementAdds increment, a 64-bit integer, to the integer value of field in the hash at key. A missing field counts as 0. The field keeps its expiry, if it has one.
Reply
- The value after the increment.
ERR hash value is not an integerif the field's value is not an integer.
Examples
> HINCRBY u age 36
(integer) 36
> HINCRBY u age 1
(integer) 37
> HSET u name Ada
(integer) 1
> HINCRBY u name 1
(error) ERR hash value is not an integer