Skip to content

Instantly share code, notes, and snippets.

@nrk
Created May 31, 2009 12:14
Show Gist options
  • Select an option

  • Save nrk/120874 to your computer and use it in GitHub Desktop.

Select an option

Save nrk/120874 to your computer and use it in GitHub Desktop.
A basic example of how to use redis-lua
require 'redis'
local redis = Redis.connect("127.0.0.1", 6379)
redis:ping() -- true
redis:increment_by("my_key", 10) -- 10
redis:increment_by("my_key", 10) -- 20
redis:exists("my_key") -- true
redis:exists("another_key") -- false
local info = redis:info()
print(info.redis_version) -- 0.101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment