I have 3 keys id=foo1, id=foo10. id=foo100. I would like to match only keys which ends with id=foo1 or contains id=foo1
So the first query should return a single result and the last query should return 3 results.
I have 3 keys id=foo1, id=foo10. id=foo100. I would like to match only keys which ends with id=foo1 or contains id=foo1
So the first query should return a single result and the last query should return 3 results.
何かのようなもの
r=Redis.new
r.keys("*foo1")
r.keys("*foo1*")
keys = ["id=foo1","id=foo10","id=foo100"]
p keys.select {|x| x.include? 'id=foo1'}
#=> ["id=foo1", "id=foo10", "id=foo100"]
p keys.select {|x| x.end_with? 'id=foo1'}
#=> ["id=foo1"]