redis - 如何删除redis zset?

标签 redis

我有键“test”,类型是zset,我想删除它。它的值很复杂。

    127.0.0.1:6379>zrange test 1 2
    1) "\x80\x02}q\x01(U\x04bodyq\x02U\x00U\t_encodingq\x03U\x05utf-8q\x04U\acookiesq\x05}q\x06U\x04metaq\a}q\bU\x05depthq\tK\x01sU\aheadersq\n}q\x0bU\aRefererq\x0c]q\rU.http://guba.eastmoney.com/list,002273,f_1.htmlq\x0easU\x03urlq\x0fX0\x00\x00\x00http://guba.eastmoney.com/list,002273,f_334.htmlU\x0bdont_filterq\x10\x89U\bpriorityq\x11K\x00U\bcallbackq\x12U\x05parseq\x13U\x06methodq\x14U\x03GETq\x15U\aerrbackq\x16Nu."
    2) "\x80\x02}q\x01(U\x04bodyq\x02U\x00U\t_encodingq\x03U\x05utf-8q\x04U\acookiesq\x05}q\x06U\x04metaq\a}q\bU\x05depthq\tK\x01sU\aheadersq\n}q\x0bU\aRefererq\x0c]q\rU.http://guba.eastmoney.com/list,002273,f_1.htmlq\x0easU\x03urlq\x0fX0\x00\x00\x00http://guba.eastmoney.com/list,002273,f_335.htmlU\x0bdont_filterq\x10\x89U\bpriorityq\x11K\x00U\bcallbackq\x12U\x05parseq\x13U\x06methodq\x14U\x03GETq\x15U\aerrbackq\x16Nu."
    127.0.0.1:6379>zcard test
    57232

值太多了,我想全部或部分删除。我该怎么做?

最佳答案

您可以使用 DEL命令从 redis 数据库中删除任何键,无论与之关联的数据类型如何。

DEL key [key ...]

Removes the specified keys. A key is ignored if it does not exist.

关于redis - 如何删除redis zset?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32250153/

相关文章:

ruby-on-rails - 测试使用 .delay 时是否创建了 Sidekiq 作业

python - 在使用 Redis 发布/订阅的 Python 服务中调试内存泄漏

caching - 如何保持你的分布式缓存干净?

caching - 维护 EC2 实例上的 redis 缓存之间的状态

redis - 有什么方法可以将 Redis 配置为对键不区分大小写?

Redis命令获取所有可用键?

python - 在 Redis Python 中创建和管理多个连接

memory-leaks - redis服务器内存占用单调递增

laravel - Redis 连接拒绝 [tcp ://127. 0.0.1:6379]

redis - 在 sidekiq 中检索队列位置