问下 弄过redis的人 为什么incr命令会报错。。“0”可以转换为 0 呀。
redis 版本是windows 3.2.100 稳定版
为情所困2017-04-27 09:04:55
It’s normal here too
127.0.0.1:6379> set test "0"
OK
127.0.0.1:6379> INCR test
(integer) 1
127.0.0.1:6379> INCR test
(integer) 2
127.0.0.1:6379> INCR test
(integer) 3
127.0.0.1:6379> get test
"3"
127.0.0.1:6379> type test
string
The version is redis-3.2.4
ringa_lee2017-04-27 09:04:55
incr
# 情况3:key不是数字值
redis> SET book "long long ago..."
OK
redis> INCRBY book 200
(error) ERR value is not an integer or out of range
I don’t know what your version is. My version is redis_version:2.4.10. The test is fine. Online test link
ringa_lee2017-04-27 09:04:55
ServiceStack.Redis client indeed omits "" for string type values. If you add an extra "", it will be self-defeating! Also, thank you
@苏生Buhuo @mylxsw