- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用 Channels Redis用于 websocket 操作。但是,我想确切地查看它在 redis 中保存的内容。这将如何完成?
这是我目前所拥有的:
>>> import redis
>>> r = redis.Redis()
>>> r.keys()
['asgi::group:chat_hello', 'asgi::group:chat_lobby', 'asgi::group:chat_hi', 'iTunes+1068285837']
>>> r.get('asgi::group:chat_hello')
redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value
最佳答案
首先,检查有问题的 key 的类型:
>>> r.type('asgi::group:chat_hello')
'zset'
它是 zet 类型,或 sorted set在redis中。要查看已排序集合的内容,您可以执行以下操作:
# r.zrange(key, 0, -1) -- 0, 1 specifies the starting and ending index,
-- where 0 is the start and -1 is the end
>>> r.zrange('asgi::group:chat_newplace', 0, -1)
['specific.AUWRSlpx!NjGkQvODgPHx']
关于python - Redis channels -- 抓取key时的WRONGTYPE操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52582339/
我正在遍历 arrayList 并使用 redis rpush 函数将字符串存储在 redis 中。但是,我收到以下错误:WRONGTYPE Operation against a key holdi
您好,我正在将 Laravel 与 Redis 结合使用。当我尝试通过 get 方法访问 key 时,出现以下错误“针对持有错误类型值的 key 进行 WRONGTYPE 操作” 我正在使用以下代码访
您好,我正在将 Laravel 与 Redis 一起使用。当我尝试通过 get 方法访问 key 时,会出现以下错误“针对持有错误类型值的 key 的 WRONGTYPE 操作” 我正在使用以下代码来
我正在使用 redis-cli 学习 HyperLogLogs 示例 The redis-cli examples show how you can use HyperLogLog commands
我正在使用带有 Redis 的 php。当我尝试通过 get 方法访问 key 时出现以下错误: WRONGTYPE Operation against a key holding the wrong
我在尝试将字符串设置为值时收到 JedisDataException,而且我似乎无法弄清楚我在哪里做错了,如果我正在做的话。 Jedis版本是2.9.0(我相信是最新的)。 redis.clients
我正在尝试使用 HMSET设置一个新的 hash 包含两个字符串字段,id 和 content。 我可以通过 redis-cli 很容易地使用 SET i 0 为 ids 初始化一个计数器,然后使用
亲爱的, 我正在创建一个脚本 python 以在 Plone 站点批量上传文件,安装的是 UnifiedInstaller Plone 4.3.10。 这个脚本读取了一个txt,这个txt用分号隔开,
在 redis-rejson 上,我正在尝试计算一个 arrayappend。我放入一个对象、一个路径、一个 json 和一个数组,如 documentation 中所示. 简介: 我的目标 => 我
我在 Windows 7 专业 64 位处理器中安装了 anaconda3 和 python 3.x。在 python 3 内核 中打开新的 jupyter 笔记本时。它显示错误信息为 "Assert
当我像这样将对象存储到 Redis 时,它工作正常 payload = {'age': 12} key = 'animals:cow' r.hmset(key, payload) 但是当我通过连接 2
我正在尝试读取 Akka 中的外部 conf/属性文件。我指的是这个 post 我只有一个配置,我需要在 myappConfiguration.properties 中添加更多属性。我可以看到属性文件
以下是我的lua脚本 if redis.call('sismember',KEYS[1],ARGV[1])==1 then redis.call('srem',KEYS[1],ARGV[1]) els
我使用以下代码通过 StackExchange.Redis 将数据推送到 REDIS,有时在生产中出现错误“针对持有错误类型值的键的 WRONGTYPE 操作”。 private static
我是一名优秀的程序员,十分优秀!