redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value
redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value
redis有几种数据类型,每一种数据类型查询的方式不同,如果查询方法和数据类型不一致就会报redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value
可以先查看一下数据类型,再使用对应的方法查询,就能解决这个问题
例如,一个Zset类型的数据,如果使用get()方法查询就会遇到这种问题

Zset类型的数据,正确的应该是使用zrange()方法。

订阅专栏 解锁全文
462

被折叠的 条评论
为什么被折叠?



