I'm would like to check that all my keys in redis are correct.
I'm storing the keys in groups like so:
userid:fname
userid:lname
userid:age
...
I would like to iterate over the them by grouping them by userid and then check each group from fname, lname and age.
How can I do this?
Repeat above code for lname and age. Or, match
user:id
and then filter the groups using a regex and iterating throughkeys
.EDIT: For large collections (millions of keys), a scan result will return a few tens of elements. Adjust your code accordingly to continue scanning until the whole collection of keys has been scanned: