Created
June 25, 2015 12:09
-
-
Save ktkaushik/812071045dd43d5f8f94 to your computer and use it in GitHub Desktop.
LUA Eval script to Delete/Expire multiple keys in Redis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EVAL "for i, name in ipairs(redis.call('KEYS', 'author_*')) do redis.call('expire', name, 0); end" 0 |
I am trying to delete multiple keys and not keys matching any particular pattern
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would you modify this for a redis cluster? @ktkaushik @aclk
redis> EVAL "for i, name in ipairs(redis.call('KEYS', KEYS)) do redis.call('del', name); end" 2 m2, m3
fails with aCROSSSLOT Keys in request don't hash to the same slot
error