当前位置:网站首页>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);
保持保存和删除时结构一致。
这是我实际工作中遇到的问题,希望对你有帮助~
边栏推荐
- SQL injection Foundation
- Recursive way
- 随着MapReduce job实现去加重,多种输出文件夹
- Why does wechat use SQLite to save chat records?
- Cobra quick start - designed for command line programs
- CSRF漏洞分析
- UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
- UDP协议:因性善而简单,难免碰到“城会玩”
- STM32+MFRC522完成IC卡号读取、密码修改、数据读写
- First, look at K, an ugly number
猜你喜欢

Easy to use PDF to SVG program

Penetration test information collection - CDN bypass

Execution process of MySQL query request - underlying principle

二叉搜索树

Hongke shares | plate by plate ar application in Beijing Winter Olympics

当保存参数使用结构体时必备的开发技巧方式

Medical image segmentation

爬虫玩得好,牢饭吃到饱?这3条底线千万不能碰!

TOP命令详解

ORACLE进阶(四)表连接讲解
随机推荐
2022暑期项目实训(一)
Huawei 0 foundation - image sorting
Why does wechat use SQLite to save chat records?
Execution process of MySQL query request - underlying principle
Some understandings of tree LSTM and DGL code implementation
epoll()无论涉及wait队列分析
被疫情占据的上半年,你还好么?| 2022年中总结
Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock
Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
Stm32+hc05 serial port Bluetooth design simple Bluetooth speaker
Self-supervised Heterogeneous Graph Neural Network with Co-contrastive Learning 论文阅读
Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
The third season of Baidu online AI competition is coming in midsummer, looking for you who love AI!
Maixll dock camera usage
监控界的最强王者,没有之一!
CRMEB 商城系统如何助力营销?
Common - magic number 7
celery最佳实践
2022-2024年CIFAR Azrieli全球学者名单公布,18位青年学者加入6个研究项目
徐翔妻子应莹回应“股评”:自己写的!