Skip to content

grosser/redis-objective

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Store objects in Redis

sudo gem install redis-objective

Usage

require 'redis/objective'
redis = Redis.new(:host => ...).objective

redis['xxx'] = {:foo => :bar}
redis['xxx'] # {:foo => :bar}
redis['xxx'] = nil # delete key 'xxx'

# Non-objects can be read:
pure = Redis.new
pure['xxx'] = 'abc'
redis['xxx'] # 'abc'

# get/set - many
redis.mset('xxx' => {:foo => :bat}, 'yyy' => 'something else') # {'xxx' => {:foo => :bar}, 'yyy' => 'something else'}
redis.mget('xxx','yyy') # {'xxx' => {:foo => :bar}, 'yyy' => 'something else'}

Supported methods

  • get / []
  • set /set_with_expire / []=
  • mget / mapped_mget
  • mset / mapped_mset
  • all other missing methods are delegated

TODO

  • also unset keys that were set to nil via mset

Author

Michael Grosser
grosser.michael@gmail.com
Hereby placed under public domain, do what you want, just do not hold me accountable...

About

Store objects in Redis

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages