redis delete all keys matching pattern code example
Example: redis delete keys that match pattern
redis-cli --scan --pattern users:* | xargs redis-cli del
# Or if you have a cluster:
redis-cli --scan --pattern users:* | xargs -L redis-cli -c del
redis-cli --scan --pattern users:* | xargs redis-cli del
# Or if you have a cluster:
redis-cli --scan --pattern users:* | xargs -L redis-cli -c del