Skip to content

Commit

Permalink
Defer server selection in Collection::drop()
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Aug 4, 2023
1 parent aebbc15 commit afed4bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,11 @@ public function distinct(string $fieldName, $filter = [], array $options = [])
*/
public function drop(array $options = [])
{
$server = select_server($this->manager, $options);

$options = $this->inheritWriteOptions($options);
$options = $this->inheritTypeMap($options);

$server = select_server($this->manager, $options);

if (! isset($options['encryptedFields'])) {
$options['encryptedFields'] = get_encrypted_fields_from_driver($this->databaseName, $this->collectionName, $this->manager)
?? get_encrypted_fields_from_server($this->databaseName, $this->collectionName, $this->manager, $server);
Expand Down

0 comments on commit afed4bd

Please sign in to comment.