Using redis ruby ​​gem, how to clear a set of redis keys matching a pattern?

I am using Redis with Ruby on Rails.

I want to remove the entire set of keys from redis in one operation, if I can. I am using the redis.rb . The keys to the records created in my test environment, and all of them contain the string ": test:" in them.

Thanks -

+4
source share
1 answer

AFAIK client.del "some_key" will try to delete some keys *

+5
source

Source: https://habr.com/ru/post/1412021/


All Articles