Skip to content

Instantly share code, notes, and snippets.

@bowin
Last active October 18, 2017 07:30
Show Gist options
  • Save bowin/8989c243e5a564f3314db78a9f4ca7ee to your computer and use it in GitHub Desktop.
Save bowin/8989c243e5a564f3314db78a9f4ca7ee to your computer and use it in GitHub Desktop.
Node.js execute lua command

clean keys

client.eval("return redis.call('del', unpack(redis.call('keys', KEYS[1])))", 1, 'sess:1*')

set key value

client.eval("return redis.call('set', KEYS[1], ARGV[1])", 1, 'key1', 'value1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment