Skip to content

Instantly share code, notes, and snippets.

@soveran
Created June 4, 2010 22:50
Show Gist options
  • Save soveran/426047 to your computer and use it in GitHub Desktop.
Save soveran/426047 to your computer and use it in GitHub Desktop.
require "redis"
require "nest"
redis = Redis.new
users = Nest.new(:users, redis)
posts = Nest.new(:posts, redis)
user = users[users.incr]
user.hmset(:name, "Albert")
post = posts[posts.incr]
redis.multi do
post.hmset(:title, "foo", :content, "bar", :author, user)
user[:posts].sadd(post)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment