nrk (owner)

Revisions

gist: 120874 Download_button fork
public
Description:
A basic example of how to use redis-lua
Public Clone URL: git://gist.github.com/120874.git
redis-lua_basic-example.lua
1
2
3
4
5
6
7
8
9
10
11
12
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