resty-redis-cluster
resty-redis-cluster copied to clipboard
how to get all keys
I want to query all the keys in the redis cluster, redis:scan (0, 'match', '*', 100) , but only the data of one node is found. How can I find the keys of all nodes?
It isn't supported on it's current state. The only commands that are supported to run on all nodes are flushdb and flushall: https://github.com/steve0511/resty-redis-cluster/blob/8fdcfb1e1318c17aed99ff139faa8649c4254512/lib/resty/rediscluster.lua#L50-L54
I think you can add KEYS to that list and it work work, note though that it would not use the SCAN method. Harder to implement.
Hope this answers your question