Skip to content

Commit e6931a0

Browse files
committed
Add options params on aggregate function
1 parent 589e329 commit e6931a0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Client.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,17 +756,18 @@ public function count(string $collection, array $filters, array $options): int
756756
*
757757
* @param string $collection
758758
* @param array $pipeline
759+
* @param array $options
759760
*
760761
* @return stdClass
761762
* @throws Exception
762763
*/
763-
public function aggregate(string $collection, array $pipeline): stdClass
764+
public function aggregate(string $collection, array $pipeline, array $options = []): stdClass
764765
{
765-
return $this->query([
766+
return $this->query(array_merge([
766767
self::COMMAND_AGGREGATE => $collection,
767768
'pipeline' => $pipeline,
768769
'cursor' => $this->toObject([]),
769-
]);
770+
], $options));
770771
}
771772

772773
/**

0 commit comments

Comments
 (0)