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中删除与特定模式匹配的键》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Spring
Bruce Tate、Justin Gehtland / O'Reilly Media, Inc. / 2005-04-12 / USD 29.95
Since development first began on Spring in 2003, there's been a constant buzz about it in Java development publications and corporate IT departments. The reason is clear: Spring is a lightweight Java......一起来看看 《Spring》 这本书的介绍吧!