linux - How to batch delete keys of a specific pattern under Redis
过去多啦不再A梦
过去多啦不再A梦 2017-06-29 10:09:05
0
2
1392

redis can find the keys of the specified pattern:

redis-cli -h [host] -p [port] -n [db] KEYS "pattern"

But how to delete the keys of a specific pattern during the delete operation?

过去多啦不再A梦
过去多啦不再A梦

reply all(2)
学霸

Delete keys of a specific pattern in batches under Redis

redis-cli -h [host] -p [port] -n [db] KEYS "pattern" | xargs redis-cli -h [host] -p [port] -n [db] DEL
淡淡烟草味

How to atomically delete keys matching a pattern using Redis

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template