S
S
Sergey2014-10-09 14:22:37
linux
Sergey, 2014-10-09 14:22:37

How to group keys in redis for scand command?

Hey!
Is it possible to group the keys that I write in MATCH for the scand command in redis?
For example, I write:
redis-cli -n 0 scan 0 MATCH *11* COUNT 100000
It will select the keys in which "11" occurs, and as I understand it, it will run through the entire database of keys and give out only those that match this regular expression. I need something like
redis-cli -n 0 scan 0 MATCH *11* COUNT 100000 | redis-cli -n 0 scan 0 MATCH *222* COUNT 100000
That is, to select keys that match the regular expression "*11*" and the regular expression "*222*", but in this case, since 2 commands will be executed, this is a construction runs through all the keys 2 times, I want it to run once, since there are a lot of keys in the database.
Is it possible to do so?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
misterion, 2014-11-07
@misterion

No, it is not possible to perform such a scan with a single command. SCAN uses highly abbreviated glob-style patterns as its match pattern , not regular expressions. There is no "or" operator in glob-style patterns.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question