Skip to content

Commit c3c5651

Browse files
committed
Empty pipelines are allowed
1 parent 89a80ba commit c3c5651

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Operation/Aggregate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ class Aggregate implements Executable, Explainable
138138
*/
139139
public function __construct(string $databaseName, ?string $collectionName, array $pipeline, array $options = [])
140140
{
141-
if (! is_pipeline($pipeline)) {
141+
// Empty pipelines are allowed
142+
if ($pipeline !== [] && ! is_pipeline($pipeline)) {
142143
throw new InvalidArgumentException('$pipeline is not a valid list of pipeline operations');
143144
}
144145

0 commit comments

Comments
 (0)