delete keys by pattern redis cli command 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