Skip to content

Commit

Permalink
PHPLIB-1305 Support "codec" option in listSearchIndexes()
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Nov 9, 2023
1 parent 22e99b8 commit d0675c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Operation/ListSearchIndexes.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(string $databaseName, string $collectionName, array
$this->databaseName = $databaseName;
$this->collectionName = $collectionName;
$this->listSearchIndexesOptions = array_intersect_key($options, ['name' => 1]);
$this->aggregateOptions = array_intersect_key($options, ['batchSize' => 1, 'collation' => 1, 'comment' => 1, 'maxTimeMS' => 1, 'readConcern' => 1, 'readPreference' => 1, 'session' => 1, 'typeMap' => 1]);
$this->aggregateOptions = array_intersect_key($options, ['batchSize' => 1, 'codec' => 1, 'collation' => 1, 'comment' => 1, 'maxTimeMS' => 1, 'readConcern' => 1, 'readPreference' => 1, 'session' => 1, 'typeMap' => 1]);

$this->aggregate = $this->createAggregate();
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Operation/ListSearchIndexesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public function provideInvalidConstructorOptions(): array
$options[][] = ['batchSize' => $value];
}

$options[][] = ['codec' => 'foo'];

return $options;
}
}

0 comments on commit d0675c3

Please sign in to comment.