Last active
July 4, 2016 06:09
-
-
Save vireshas/99bc322cf0ac42fbf7ee to your computer and use it in GitHub Desktop.
Using redi2casa gem.
This file contains 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
#hincrby & hget | |
r.hincrby "c", "e", 10 | |
r.hincrby "c", "e", -10 | |
r.hget "c", "e" | |
r.hget "c", "e", "counters" #counters is the default type | |
#hset & hget | |
r.hset "a", "b", "hello_world" | |
r.hget "a", "b", "sets" | |
#hgetall | |
r.hgetall "c" or r.hgetall "c", "counters" #counters is the default type | |
r.hgetall "a", "sets" | |
#lpush, ltrim, lpop, lrange | |
r.lpush "a", "hello" | |
r.lpush "a", "hello1" | |
r.lpush "a", "hello2" | |
r.lrange "a", 0, -1 | |
r.lpop "a" | |
r.ltrim "a", 0, 1 | |
#rpush, rpop | |
r.rpush "a", "hello3" | |
r.rpop "a" | |
r.lrange "a", 0, -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment