Skip to content

Commit e167204

Browse files
committed
[12.x] keys for PredisClusterConnection
1 parent 526c803 commit e167204

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Illuminate/Redis/Connections/PredisClusterConnection.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,19 @@ public function flushAll()
3535
$node->executeCommand(tap(new FLUSHALL())->setArguments(func_get_args()));
3636
}
3737
}
38+
39+
/**
40+
* Returns the keys that match a certain pattern.
41+
*
42+
* @param string $pattern
43+
* @return array
44+
*/
45+
public function keys(string $pattern)
46+
{
47+
$keys = [];
48+
foreach ($this->client as $node) {
49+
$keys[] = $node->keys($pattern);
50+
}
51+
return array_merge(...$keys);
52+
}
3853
}

0 commit comments

Comments
 (0)