Last active
June 28, 2018 13:39
-
-
Save wevtimoteo/f6c9fd91908f7dbe622bf23f7a38b2ae to your computer and use it in GitHub Desktop.
Removing keys by namespace with Redis-RB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%w( | |
months* | |
extract* | |
payment* | |
consolidate* | |
agenda* | |
brands | |
car_model* | |
car* | |
visit_types* | |
).each do |wildcard| | |
keys = $redis.keys(wildcard) | |
unless keys.empty? | |
puts " --> With wildcard #{wildcard}, removing #{keys.size} keys..." | |
puts $redis.del(*keys) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment