KEYS * foo:1 foo:2 bar:1 foo:3 bar:2 foo:4
正如在该问题的评论中所提到的,这里已经有许多其他答案.如果您正考虑在生产服务器中执行此操作,请务必阅读上面链接的内容.
我发现对偶尔的命令行清理最有用的是:
redis-cli KEYS“*”| xargs redis-cli DEL
从 “How to atomically delete keys matching a pattern using Redis” .
翻译自:https://stackoverflow.com/questions/28575542/how-to-delete-keys-matching-a-certain-pattern-in-redis
转载注明原文: 如何在redis中删除与特定模式匹配的键
以上所述就是小编给大家介绍的《如何在redis中删除与特定模式匹配的键》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Cracking the Coding Interview
Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95
Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!