Created
May 31, 2009 12:14
-
-
Save nrk/120874 to your computer and use it in GitHub Desktop.
A basic example of how to use redis-lua
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
| 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