当前位置:网站首页>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);
保持保存和删除时结构一致。
这是我实际工作中遇到的问题,希望对你有帮助~
边栏推荐
- None of the strongest kings in the monitoring industry!
- STM32+MFRC522完成IC卡号读取、密码修改、数据读写
- 【中山大学】考研初试复试资料分享
- Cobra quick start - designed for command line programs
- Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock
- How does crmeb mall system help marketing?
- Reprint: defect detection technology of industrial components based on deep learning
- [swoole series 2.1] run the swoole first
- [Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
- Example of implementing web server with stm32+enc28j60+uip protocol stack
猜你喜欢
44 colleges and universities were selected! Publicity of distributed intelligent computing project list
win10系统下插入U盘有声音提示却不显示盘符
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
阿里云国际版ECS云服务器无法登录宝塔面板控制台
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
The role of applet in industrial Internet
44所高校入选!分布式智能计算项目名单公示
Splay
线代笔记....
随机推荐
【LeetCode第 300 场周赛】
C#/VB.NET 给PDF文档添加文本/图像水印
AFNetworking框架_上传文件或图像server
POJ 2208 six lengths of tetrahedron are known, and the volume is calculated
Coco2017 dataset usage (brief introduction)
Jdbc driver, c3p0, druid and jdbctemplate dependent jar packages
徐翔妻子应莹回应“股评”:自己写的!
TOP命令详解
2022暑期项目实训(三)
转载:基于深度学习的工业品组件缺陷检测技术
How does crmeb mall system help marketing?
Atcoder a mountaineer
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
C language exchanges two numbers through pointers
2022 Summer Project Training (I)
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
44 colleges and universities were selected! Publicity of distributed intelligent computing project list
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
关于npm install 报错问题 error 1
Windows connects redis installed on Linux