Created
January 18, 2020 10:35
-
-
Save bamthomas/17c3e3086620b7ef58d10d7bf8d64f8d to your computer and use it in GitHub Desktop.
redis CLI : transform a set into a map
This file contains hidden or 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 "local vals = redis.call('SMEMBERS', KEYS[1]); local len = redis.call('SCARD', KEYS[1]); for k, v in pairs(vals) do redis.call('HSET', KEYS[2], v, '0'); end; return len;" 2 setkey mapkey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment