Skip to content

Instantly share code, notes, and snippets.

@bnoguchi
Created July 15, 2010 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoguchi/477686 to your computer and use it in GitHub Desktop.
Save bnoguchi/477686 to your computer and use it in GitHub Desktop.
git clone http://github.com/bnoguchi/redis/tree/sort_get_hash_all_keys
cd redis
make
sudo make install
make test
sudo redis-server
git clone http://github.com/bnoguchi/redis-rb/tree/sort_get_hash_all_keys
cd redis
ruby sample.rb
require "lib/redis"
r = Redis.new
r.hmset("items:1", "a", 1, "b", 2)
r.hmset("items:2", "a", 3, "b", 4)
r.hset("items:3", "we_can_use_any_hash_structure", "really!!")
r.lpush("list", 1)
r.lpush("list", 2)
r.lpush("list", 3)
r.sort("list", :by => "nosort", :get => "items:*")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment