我正在将 Laravel 与 Redis 一起使用.当我尝试通过 get 方法访问密钥时,出现以下错误针对持有错误类型值的密钥的错误类型操作"
Hi I am using Laravel with Redis .When I am trying to access a key by get method then get following error "WRONGTYPE Operation against a key holding the wrong kind of value"
我正在使用以下代码访问键值 -
I am using following code to access the key value -
我使用此代码从 redis 获取数据
i use this code for get data from redis
$values = "l_messages";
$value = $redis->HGETALL($values);
print($value);
Redis 支持 6 种数据类型.您需要知道一个键映射到什么类型的值,至于每个数据类型,检索它的命令是不同的.
Redis supports 6 data types. You need to know what type of value that a key maps to, as for each data type, the command to retrieve it is different.
这里是检索键值的命令:
Here are the commands to retrieve key value:
<开始><end>
<分钟><max>
流
.https://redis.io/commands/xread使用 TYPE
命令检查一个键的值的类型映射到:
Use the TYPE
command to check the type of value a key is mapping to:
这篇关于WRONGTYPE 针对持有错误类型值 php 的键的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!