Add options params on aggregate function

This commit is contained in:
Jake Barnby committed 2025-09-26 21:05:00 +12:00
1 parent 589e329a7f
commit e6931a050e
1 file changed
+4 -3
+4 -3
View File
@@ -756,17 +756,18 @@ class Client
*
* @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));
}
/**