From e6931a050e5aae898b03e240b8c477b70521b0fb Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 26 Sep 2025 21:05:00 +1200 Subject: [PATCH] Add options params on aggregate function --- src/Client.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)); } /**