INCRBY

Syntax
INCRBY key increment
Available since:
1.0.0
Time complexity:
O(1)
ACL categories:
@write, @string, @fast,

将存储在key中的数字增加increment。 如果键不存在,则在执行操作之前将其设置为0。 如果键包含错误类型的值或包含无法表示为整数的字符串,则返回错误。 此操作仅限于64位有符号整数。

有关递增/递减操作的更多信息,请参见INCR

示例

SET mykey "10" INCRBY mykey 5

RESP2/RESP3 回复

Integer reply: the value of the key after the increment.
RATE THIS PAGE
Back to top ↑