5
我不理解如何在Redis中創建持久存儲。使用選項散列是我看到在路徑中傳遞的唯一位置,它似乎沒有任何影響。如何命名和存儲我的數據集在redis中?
> r = Redis.new({:options => {:path => '~/redis_store'}})
=> #<Redis client v2.2.0 connected to redis://127.0.0.1:6379/0 (Redis v2.9.0)>
> r['foo']
=> "bar"
> s = Redis.new({:options => {:path => '~/redis_store2'}})
=> #<Redis client v2.2.0 connected to redis://127.0.0.1:6379/0 (Redis v2.9.0)>
> s['foo']
=> "bar"