I have previously used the KEYS command to search for keys matching a certain pattern in my Redis database. Since Redis 2.8, the SCAN command seems to be preferred over KE
KE
Maybe this is helpful for other Predis beginners and you're coming from a PHP/MySQL background like me you can use this:
foreach (new Iterator\HashKey($client, $pattern) as $index => $value) { ... }
When you previously generated an array dataset with $client->hmset($index, $array).
$client->hmset($index, $array)