We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 907e205 commit 85c13bdCopy full SHA for 85c13bd
src/main/php/com/mongodb/io/Protocol.class.php
@@ -178,9 +178,10 @@ public function candidates($rp) {
178
* @return void
179
*/
180
public function useCluster($server) {
181
- $this->nodes= ['primary' => $server['primary'] ?? key($this->conn), 'secondary' => []];
+ $primary= $server['primary'] ?? key($this->conn);
182
+ $this->nodes= ['primary' => $primary, 'secondary' => []];
183
foreach ($server['hosts'] ?? [] as $host) {
- if ($server['primary'] !== $host) $this->nodes['secondary'][]= $host;
184
+ if ($primary !== $host) $this->nodes['secondary'][]= $host;
185
}
186
shuffle($this->nodes['secondary']);
187
0 commit comments