Skip to content

Instantly share code, notes, and snippets.

@gdoteof
Created March 20, 2015 23:39
Show Gist options
  • Save gdoteof/c31e8a9d4c50630a2028 to your computer and use it in GitHub Desktop.
Save gdoteof/c31e8a9d4c50630a2028 to your computer and use it in GitHub Desktop.
HRANDKEY
--use like eval(HRANDKEY, 2, key_for_set_with_keys, key_for_hash_with_keys)
local randkey = redis.call('srandmember', KEYS[1])
local val = redis.call('hget', KEYS[2], randkey)
return val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment