Skip to content

Commit afed4bd

Browse files
committed
Defer server selection in Collection::drop()
1 parent aebbc15 commit afed4bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,11 @@ public function distinct(string $fieldName, $filter = [], array $options = [])
445445
*/
446446
public function drop(array $options = [])
447447
{
448-
$server = select_server($this->manager, $options);
449-
450448
$options = $this->inheritWriteOptions($options);
451449
$options = $this->inheritTypeMap($options);
452450

451+
$server = select_server($this->manager, $options);
452+
453453
if (! isset($options['encryptedFields'])) {
454454
$options['encryptedFields'] = get_encrypted_fields_from_driver($this->databaseName, $this->collectionName, $this->manager)
455455
?? get_encrypted_fields_from_server($this->databaseName, $this->collectionName, $this->manager, $server);

0 commit comments

Comments
 (0)