Redis deletes data using scan matching

This command was executed in production redis

# scan,以非阻塞的方式实现key值的查找,将redis中以saas-pay@开头的key用scan删除
redis-cli -h 100.100.100.100 -a 'PASSWD' -n 7 -p 6379 --scan --pattern 'saas-pay@*' | xargs redis-cli -h 100.100.100.100 -a 'PASSWD' -n 7 -p 6379 del

Guess you like

Origin blog.51cto.com/12131824/2489700