5290589 发表于 2016-12-20 10:30:17

Redis_Error搜集_(error) ERR value is not a double

Redis_Error搜集_(error) ERR value is not a double
  (error) ERR value is not a double
  这个命令提示错误原因:类型不对。
  对于zadd来说,参数有3个,key, score, value,score需要是double的,因此需要仔细检查score的值。
  redis 127.0.0.1:6379> zadd myset '0' 'lee3'
  (error) ERR value is not a double
  redis 127.0.0.1:6379> zadd myset 0 'lee3'
  (integer) 1
  (error) ERR Operation against a key holding the wrong kind of value
  原因:key对应的值,不符合操作命令! 
  例如:一个key存入的是set,结果取数据的时候当成了hash来取;
  这种错误很容易在key写错的情况下发生。
  怎么排查: 先看看这个key存储的数据类型,用命令type key
  例子:
  redis 127.0.0.1:6379> zrange users:1 0 -1
  (error) ERR Operation against a key holding the wrong kind of value
  redis 127.0.0.1:6379> type myset
  zset






++++
+++
++
+        待补充-->>
++
+++
++++
页: [1]
查看完整版本: Redis_Error搜集_(error) ERR value is not a double