正如标题所示,我使用的是Redis gem,这里是输出:
2.2.2 :011 > $redis = Redis.connect
=> #<Redis client v3.2.1 for redis://127.0.0.1:6379/0>
2.2.2 :012 > $redis.set("max-tag-id", "hi")
=> "OK"
2.2.2 :013 > $redis.get("max-tax-id")
=> nil
2.2.2 :014 > $redis.set("max_tag_id", "hi")
=> "OK"
2.2.2 :015 > $redis.get("max_tax_id")
=> nil
2.2.2 :016 > $redis.set("maxtagid", "hi")
=> "OK"
2.2.2 :018 > $redis.get("maxtagid")
=> "hi"
为什么这???
答案 0 :(得分:0)
每当你得到nil你得到“max_tax_id”时你就永远不会设置那个键。你设置“max_tag_id”