我有键“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/