当前位置:网站首页>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);
保持保存和删除时结构一致。
这是我实际工作中遇到的问题,希望对你有帮助~
边栏推荐
- 监控界的最强王者,没有之一!
- [the 300th weekly match of leetcode]
- Top command details
- 转载:基于深度学习的工业品组件缺陷检测技术
- Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
- STM32+HC05串口蓝牙设计简易的蓝牙音箱
- Unity资源顺序加载的一个方法
- Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
- 解读云原生技术
- Ms-tct: INRIA & SBU proposed a multi-scale time transformer for motion detection. The effect is SOTA! Open source! (CVPR2022)...
猜你喜欢
随机推荐
Hongke shares | plate by plate ar application in Beijing Winter Olympics
Cobra 快速入门 - 专为命令行程序而生
JDBC驱动器、C3P0、Druid和JDBCTemplate相关依赖jar包
2022 Summer Project Training (II)
Stm32+esp8266+mqtt protocol connects onenet IOT platform
STM32+ENC28J60+UIP协议栈实现WEB服务器示例
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
Numerical analysis: least squares and ridge regression (pytoch Implementation)
win10系统下插入U盘有声音提示却不显示盘符
图片缩放中心
Self supervised heterogeneous graph neural network with CO comparative learning
深度循环网络长期血压预测【翻译】
C语言自动预订飞机票问题
文档编辑之markdown语法(typora)
Top command details
bonecp使用数据源
Recommend easy-to-use backstage management scaffolding, everyone open source
Execution process of MySQL query request - underlying principle
Cocos2d Lua smaller and smaller sample memory game
There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed




![[swoole series 2.1] run the swoole first](/img/cd/88abf7e83e9d9d416051b33263690b.png)




