-
Notifications
You must be signed in to change notification settings - Fork 1k
Redis rb Overview
ipoval edited this page Aug 17, 2011
·
7 revisions
Ruby client library for redis
Start:
require "redis"
redis = Redis.new
Keys:
redis.set("redis_db", "great k / v storage") # => OK
redis.get("redis_db") # => "great k / v storage"
Counters:
redis.incr("redis_db") # => 1
redis.decr("couch_db") # => -1
redis.incrby("redis_db", 99) # => 100
redis.decrby("couch_db", -101) # => 100
Expiration:
redis.expire("redis_db", 100) # => true