Skip to content

Commit 2aa92f9

Browse files
committed
Support options
1 parent 6f74844 commit 2aa92f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Query/PipelineBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ public function addRawStage(string $operator, mixed $value): static
3636
/**
3737
* Execute the aggregation pipeline and return the results.
3838
*/
39-
public function get(): LaravelCollection
39+
public function get(array $options = []): LaravelCollection
4040
{
4141
$encoder = new BuilderEncoder();
4242
$pipeline = $encoder->encode($this->getPipeline());
4343

4444
$options = array_replace(
4545
['typeMap' => ['root' => 'array', 'document' => 'array']],
4646
$this->options,
47+
$options,
4748
);
4849

4950
return collect($this->collection->aggregate($pipeline, $options)->toArray());

0 commit comments

Comments
 (0)