Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

redis delete keys by pattern

This one is working for big number of keys: 
EVAL "local keys = redis.call('keys', ARGV[1]) 
 for i=1,#keys,5000 do 
 redis.call('del', unpack(keys, i, math.min(i+4999, #keys))) 
 end 
 return keys" 0 prefix:*
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #redis #delete #keys #pattern
ADD COMMENT
Topic
Name
2+4 =