4 ms·
def dump filter=nil filter ||= '*' entries = [] each_database do |redis| chunk_entries = [] dump_keys = redis.keys(filter)
by redbad 15y ago
def dump filter=nil
filter ||= '*'
entries = []
each_database do |redis|
chunk_entries = []
dump_keys = redis.keys(filter)
. . .
http://redis.io/commands/keys http://redis.io/commands/keys
Warning: consider KEYS as a command that should only be used in production environments with extreme care. It may ruin performance when it is executed against large databases. This command is intended for debugging and special operations, such as changing your keyspace layout. Don't use KEYS in your regular application code.
- delano 15y agoYep, good eye. It's not an ideal approach but using KEYS is the only option for a non-specific tool. The right solution is to have something similar build into redis-cli (see antirez's link above).