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 ...
随机推荐
- 修改Myecclipse servlet/jsp的默认模板
点击图片下载模板: 用winrar等打开myeclipse安装目录下的com.genuitec.eclipse.wizards*.jar,替换响应文件. 详细版:http://www.cnblogs. ...
- 345. Reverse Vowels of a String
Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Giv ...
- ZOJ 1234 Chopsticks
原题链接 题目大意:有这么一个公式 A,B,C(A<=B<=C), (A-B)^2来衡量这对数字的好坏,值越小越好.现在给出一个数组,要求每三个配对,最后得到的每组值总和最小. 解法:我是 ...
- android中的空格及汉字的宽度
在Android布局中进行使用到空格,以便实现文字的对齐.那么在Android中如何表示一个空格呢? 空格: 窄空格: 一个汉字宽度的空格: [用两个空格( )占一个汉字的宽度时,两个空格比 ...
- leetcode 108 Convert Sorted Array to Binary Search Tree ----- java
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 给一 ...
- 卸载linux自带版本JDK
1)卸载系统自带的jdk版本: 查看自带的jdk: #rpm -qa|grep gcj 可能看到如下类似的信息: libgcj-4.1.2-44.el5 java-1.4 ...
- LeetCode(228) Summary Ranges
Given a sorted integer array without duplicates, return the summary of its ranges. For example, give ...
- mac下使用Solarized配色方案
Solarized配色方案不用多介绍了.具体点击这里:http://ethanschoonover.com/solarized 我们首先搞定macvim 你需要下载solarized.vim配色文件, ...
- poj1511 最短路
题意:与poj3268一样,所有人需要从各点到一点再从一点到各点,求最短路总和. 与poj3268一样,先正向建图跑 dijkstra ,得到该点到其他所有各点的最短路,即这些人回去的最短路,再用反向 ...
- 【P1835】小红花
很简单的题,然而我没想到,在NOIP上怎么办嘛QAQ 话说这题不知道怎么分类啊……先扔到玄学里边把…… 原题: Fj在圣诞节来临之际,决定给他的奶牛发一些小红花.现在Fj一共有N头奶牛,这N头牛按照编 ...