参考文章: WRONGTYPE Operation against a key holding the wrong kind of value
用LPush的方式存进redis,用SPop的方式取值时,报了这个错误。
原因:LPush存进redis的,数据类型是List;而SPop只能对集合Set操作,所以就报错了。
解决:改成用SAdd存进redis
LPush和LPop、LLen对应
SAdd和SPop、SCard对应
参考文章: WRONGTYPE Operation against a key holding the wrong kind of value
用LPush的方式存进redis,用SPop的方式取值时,报了这个错误。
原因:LPush存进redis的,数据类型是List;而SPop只能对集合Set操作,所以就报错了。
解决:改成用SAdd存进redis
LPush和LPop、LLen对应
SAdd和SPop、SCard对应