Redis报错:WRONGTYPE Operation against a key holding the wrong kind of value 解决处理
首先应该明白报这个错误说明了你用的jedis方法与redis服务器中存储数据的类型存在冲突。
例如:数据库中有一个key的数据存储的是Hash类型的,但是你使用jedis执行数据操作的时候却使用了非Hash的操作方法。此时就会报
WRONGTYPE Operation against a key holding the wrong kind of value这个错误!
问题解决:
先执行一条如下命令:
redis 127.0.0.1:6379>type key
此时会显示出该key存储在现在redis服务器中的类型,例如:
redis 127.0.0.1:6379>hash
则表示key为以hash类型存储在redis服务器里的,此时操作这个数据就必须使用hset、hget等操作方法。
如果是zset如下:
redis 127.0.0.1:6379>zset
则表示数据类型为Sorted Sets的。此时就需要使用zadd、zrange等操作方法,否则就会报WRONGTYPE Operation against a key holding the wrong kind of value这个错误!
Redis报错:WRONGTYPE Operation against a key holding the wrong kind of value 解决处理的更多相关文章
- Redis发生异常WRONGTYPE Operation against a key holding the wrong kind of value
Redis发生异常WRONGTYPE Operation against a key holding the wrong kind of value Redis发生异常WRONGTYPE Operat ...
- Redis:WRONGTYPE Operation against a key holding the wrong kind of value
相关连接:通过Canal保证某网站的Redis与MySql的数据自动同步 1.错误信息 redis.clients.jedis.exceptions.JedisDataException: WRONG ...
- redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value
错误原因: 因为redis中已经存在了相同的key, 而且key对应的值类型并不是Set,而是SortSet(改动前):再调用smembers时,抛出此错误. 解决方法: 将原来的的key给Del掉, ...
- Caused by: redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value
对错误类型key的操作,也就是说redis中没有你当前操作的这个key,而你用这个key去执行某些操作!检查key是否正确
- WRONGTYPE Operation against a key holding the wrong kind of value
今天改动代码,一运行就跑错了,错误原因: 因为redis中已经存在了相同的key, 而且key对应的值类型并不是Set,而是SortSet(改动前):再调用smembers时,抛出此错误. 解决方法: ...
- redis 报Operation against a key holding the wrong kind of value警告的解决方法
WRONGTYPE Operation against a key holding the wrong kind of value github:https://github.com/antirez/ ...
- filebeat output redis 报错 i/o timeout
filebeat output redis 报错 i/o timeout 先把报错内容贴出来. ERROR redis/client. go: Failed to RPUSH to redis li ...
- mac brew install redis 报错
mac brew install redis 报错 /usr/local/opt/php55/bin/phpize /usr/local/opt/php55/bin/phpize: line 61: ...
- redis报错Windows error 0x70(a large memory)
redis报错Windows error 0x70 redis 嫌弃你内存不够了,就给你不开第二个实例. The Windows version of Redis allocates a large ...
随机推荐
- subprocess module
subprocess 主要用于执行外部命令和程序, 极大的增强了Python的功能. 比如你要用bowtie, 你可以在python中调用这个程序. 运行python时,我们都是在创建并运行一个进程, ...
- 设计模式 : Template method 模板方法模式 -- 行为型
设计模式中,模板模式面向的是方法级别的流程.(不过好像世界上大部分问题,都可以抽象点.抽象点吧,最后抽象到一个方法里面吧.) 1. 一个方法,可以用来描述一个流程,这个流程涉及多个环节,不同环节可 ...
- unable to open sync connection
有些时候,在你向连接好的Android机器中按照程序时会遭遇失败,logcat提示“unable to open sync connection”. 一般情况下,重启手机几乎肯定可以解决这个问题. 如 ...
- Map/Reduce的类体系架构
Map/Reduce的类体系架构 Map/Reduce案例解析: 先以简单的WordCount例程, 来讲解如何去描述Map/Reduce任务. public static void main(Str ...
- uestc1888 Birthday Party 组合数学,乘法原理
题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=25539#problem/G 题目意思: 有n个人,每个人有一个礼物,每个人能拿 ...
- Sql Server_笔记
1.随机取出10条数据:select top 10 * from tablename order by newid()
- numpy常用函数
numpy.ndarray.astype 更改np.array的类型.
- img元素底部有空白间距的问题
<div style="width:100px;height:100px"><img src="./1.jpg"></div> ...
- GOOGLE的专业使用方法(转)
搜索引擎命令大全! 1.双引号 把搜索词放在双引号中,代表完全匹配搜索,也就是说搜索结果返回的页面包含双引号中出现的所有的词,连顺序也必须完全匹配.bd和Google 都支持这个指令.例如搜索: “s ...
- 套接字I/O模型-select
共有6种类型套接字I/O模型.blocking(阻塞),select(选择),WSAAsyncSelect(异步选择),WSAEventSelect(事件选择),overlapped(重叠),comp ...