Last active
April 19, 2017 21:25
-
-
Save jdrydn/c78617329f71500222b7 to your computer and use it in GitHub Desktop.
Grab your shovels, that Redis instance won't be around much longer
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
-- Usage: HINCRALLBY AKeyOfYourChoice 1 | |
-- HKEYS AKeyOfYourChoice | |
-- HINCRBY AKeyOfYourChoice KEY 1 | |
-- Not sure on performance or what would happen with a hash of 100,000 keys | |
-- And I don't really want to find out! | |
local keys = redis.call("HKEYS", ARGV[1]) | |
local results = {} | |
for i,k in ipairs(keys) do results[i] = redis.call("HINCRBY", ARGV[1], keys[i], ARGV[2]) end | |
return results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment