I want to delete redis keys that DO NOT match a particular pattern. Redis data looks like this -
prefix9_key1
prefix9_key2
prefix11_key1
prefix11_key2
prefix2_key1
prefix2_key2
These prefix values are randomly generated numbers (example 1123, 3422, 9879).
I know what my current prefix is (let's say it is prefix11). But there is no way to know what were the earlier prefixes being used. I want to delete all keys that DO NOT use current prefix value (prefix2* and prefix9*).
I read many posts mentioning deleting keys matching a pattern. I want to delete keys that do not match a particular pattern.