Skip to content

Instantly share code, notes, and snippets.

@boydc7
Created August 17, 2018 15:52
Show Gist options
  • Save boydc7/04614371b43cb7a2666420dd5aa55bc1 to your computer and use it in GitHub Desktop.
Save boydc7/04614371b43cb7a2666420dd5aa55bc1 to your computer and use it in GitHub Desktop.
Redis remove keys matching prefix
EVAL "local keys = redis.call('keys', ARGV[1]) \n for i=1,#keys,5000 do \n redis.call('del', unpack(keys, i, math.min(i+4999, #keys))) \n end \n return keys" 0 PUT_PREFIX_TO_DELETE_HERE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment