当前位置:网站首页>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);
保持保存和删除时结构一致。
这是我实际工作中遇到的问题,希望对你有帮助~
边栏推荐
- AFNetworking框架_上传文件或图像server
- Top command details
- 被疫情占据的上半年,你还好么?| 2022年中总结
- Maixll-Dock 摄像头使用
- 從交互模型中蒸餾知識!中科大&美團提出VIRT,兼具雙塔模型的效率和交互模型的性能,在文本匹配上實現性能和效率的平衡!...
- With the implementation of MapReduce job de emphasis, a variety of output folders
- 使用block实现两个页面之间的传统价值观
- There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed
- [Matlab] Simulink 同一模块的输入输出的变量不能同名
- Distill knowledge from the interaction model! China University of science and Technology & meituan proposed virt, which combines the efficiency of the two tower model and the performance of the intera
猜你喜欢
10、 Process management
There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed
Ms-tct: INRIA & SBU proposed a multi-scale time transformer for motion detection. The effect is SOTA! Open source! (CVPR2022)...
Rb157-asemi rectifier bridge RB157
Grafana 9.0 正式发布!堪称最强!
The role of applet in industrial Internet
Excellent open source fonts for programmers
Introduction and case analysis of Prophet model
30 minutes to understand PCA principal component analysis
Prophet模型的简介以及案例分析
随机推荐
None of the strongest kings in the monitoring industry!
Cocos2d Lua 越来越小样本 内存游戏
巨杉数据库首批入选金融信创解决方案!
阿里云国际版ECS云服务器无法登录宝塔面板控制台
Automatic reservation of air tickets in C language
The role of applet in industrial Internet
徐翔妻子应莹回应“股评”:自己写的!
Introduction and case analysis of Prophet model
POJ 2208 已知边四面体六个长度,计算体积
Cobra 快速入门 - 专为命令行程序而生
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
echart简单组件封装
Excel usage record
287. Find duplicates
Grafana 9.0 is officially released! It's the strongest!
随着MapReduce job实现去加重,多种输出文件夹
首先看K一个难看的数字
Penetration test information collection - CDN bypass
Wchars, coding, standards and portability - wchars, encodings, standards and portability
10、 Process management