INCRBY
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
INCR key
This command adds 1 to the number that is associated with the given key
. The numeric value must a 64-bit signed integer.
- If the
key
does not exist, the associated string is set to “0”. - If the given
key
is associated with a non-string value, or if its associated string cannot be converted to an integer, an error is raised.
Return Value
Returns the value after addition.
Examples
You can do this as shown below.
$ SET yugakey 7
"OK"
$ INCRBY yugakey 3
10
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .