Redis - (error) WRONGTYPE Operation against a key holding the wrong kind of value

发布时间 2024-01-11 20:09:00作者: ZhangZhihuiAAA

 

zzh@ZZHPC:~$ docker exec -it redis redis-cli
127.0.0.1:6379> SET bike:1 "Process 134"
OK
127.0.0.1:6379> GET bike:1
"Process 134"
127.0.0.1:6379> HSET bike:1 model Deimos brand Ergonom type 'Enduro bikes' price 4972
(error) WRONGTYPE Operation against a key holding the wrong kind of value

This is because bike:1 has already been used by command SET.