is it possible to get a list of keys matching a pattern?
See original GitHub issuesomething like
db.keys('foo*', function(err, keys) {
if (err) return;
db.batch( keys.map(function(key) { return {type: 'del', key: key }; } ), done );
});
or maybe using a regexp
db.match(/foo.*/, function(err, keys) {
if (err) return;
db.batch( keys.map(function(key) { return {type: 'del', key: key }; } ), done );
});
kind of hoped node-level-multiply to handle that for second, but I am not sure it’s possible.
Thanks
Issue Analytics
- State:
- Created 9 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Redis: Find keys matching a pattern - Stack Overflow
Use a set for storing the key names of the pattern you want. When you add a new we key, add the name...
Read more >Get number of keys, matching a pattern - Google Groups
googlegroups.com. Hi, list. I have a zillion keys in my redis DB. Sometimes, very rarely, I need to count all of them, matching...
Read more >Find and Delete multiple keys matching by a pattern in Redis
Use scanstream to find and pipeline to delete keys matching pattern.Find and Delete multiple keys matching by a pattern in Redis in a...
Read more >KEYS pattern
Returns all keys matching pattern . While the time complexity for this operation is O(N), the constant times are fairly low.
Read more >KEYS - Redis
O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There’s a
createKeyStream
method, which you should be able to use the standardlt
,lte
,gt
,gte
range operators with:@rvagg Thanks.