INCRBYincrement by
概要Description
签名
INCRBY key increment -> int | | str int
功能
将 key 映射的值 增加 increment,并返回增加后的值
广告
案例Examples
正常情况
有键值对
如果曾经键值对的值 是 可以转化为 int 的
> < > <SET count 2OKINCRBY count 35
没键值对
如果没有以 key 为键的键值对
视为在 0 的基础上 加 increment
> <INCRBY count 33
类型校验
键值对的值,必须是 可以转化为 int 的,否则会报错
> < > <SET score 67.3OKINCRBY score 10(error) ERR value is not an integer or out of range
广告