diff --git a/src/Client.php b/src/Client.php index 6253592..e374806 100644 --- a/src/Client.php +++ b/src/Client.php @@ -756,17 +756,18 @@ public function count(string $collection, array $filters, array $options): int * * @param string $collection * @param array $pipeline + * @param array $options * * @return stdClass * @throws Exception */ - public function aggregate(string $collection, array $pipeline): stdClass + public function aggregate(string $collection, array $pipeline, array $options = []): stdClass { - return $this->query([ + return $this->query(array_merge([ self::COMMAND_AGGREGATE => $collection, 'pipeline' => $pipeline, 'cursor' => $this->toObject([]), - ]); + ], $options)); } /**