AttentionThis page documents an earlier version. Go to the latest version.
HINCRBY key field delta
This command adds
delta to the number that is associated with the given field
field for the hash
key. The numeric value must a 64-bit signed integer.
keydoes not exist, a new hash container is created. If the field
fielddoes not exist in the hash container, the associated string is set to “0”.
keyis not associated with a hash type, or if the string associated with
fieldcannot be converted to an integer, an error is raised.
Returns the value after addition.
$ HSET yugahash f1 5
$ HINCRBY yugahash f1 3
$ HINCRBY yugahash non-existent-f2 4
$ HINCRBY non-existent-yugahash f1 3