Skip to content

Commit 08109a5

Browse files
committed
Empty pipelines are allowed
1 parent f812b1e commit 08109a5

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
@@ -137,7 +137,8 @@ class Aggregate implements Executable, Explainable
137137
*/
138138
public function __construct(string $databaseName, ?string $collectionName, array $pipeline, array $options = [])
139139
{
140-
if (! is_pipeline($pipeline)) {
140+
// Empty pipelines are allowed
141+
if ($pipeline !== [] && ! is_pipeline($pipeline)) {
141142
throw new InvalidArgumentException('$pipeline is not a valid list of pipeline operations');
142143
}
143144

0 commit comments

Comments
 (0)