当前位置:网站首页>RedisSystemException:WRONGTYPE Operation against a key holding the wrong kind of value
RedisSystemException:WRONGTYPE Operation against a key holding the wrong kind of value
2022-07-06 10:44:00 【热爱生活的猴子】
一、错误提示
我在删除缓存的时候报了这个错:WRONGTYPE Operation against a key holding the wrong kind of value
二、错误含义
针对持有错误类型值的键的错误类型操作
三、出现错误的原因
我在保存缓存的时候使用的是zset结构:
redisTemplate.opsForSet().add(key,value);
但是我在删除的时候这个缓存的时候使用的是:
redisTemplate.opsForZSet().remove(key,value);
所以因为数据结构不一致导致,删除时报错。
四、解决办法
删除缓存结构时改成Set:
redisTemplate.opsForSet().remove(key,value);
保持保存和删除时结构一致。
这是我实际工作中遇到的问题,希望对你有帮助~
边栏推荐
猜你喜欢
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
MySQL查询请求的执行过程——底层原理
Collection of penetration test information -- use with nmap and other tools
关于npm install 报错问题 error 1
Grafana 9.0 is officially released! It's the strongest!
Penetration test information collection - WAF identification
爬虫玩得好,牢饭吃到饱?这3条底线千万不能碰!
Splay
阿里云国际版ECS云服务器无法登录宝塔面板控制台
Implementation of queue
随机推荐
解读云原生技术
测试1234
Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
CRMEB 商城系统如何助力营销?
复现Thinkphp 2.x 任意代码执行漏洞
Coco2017 dataset usage (brief introduction)
On time and parameter selection of asemi rectifier bridge db207
Recursive way
Distiller les connaissances du modèle interactif! L'Université de technologie de Chine & meituan propose Virt, qui a à la fois l'efficacité du modèle à deux tours et la performance du modèle interacti
Recommend easy-to-use backstage management scaffolding, everyone open source
Echart simple component packaging
二叉搜索树
node の SQLite
POJ 2208 已知边四面体六个长度,计算体积
Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock
Xu Xiang's wife Ying Ying responded to the "stock review": she wrote it!
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
10、 Process management
atcoder它A Mountaineer
win10系统下插入U盘有声音提示却不显示盘符