Skip to content

Commit 68ef50d

Browse files
committed
SERVER-6131 Describe new behavior when $unwind is applied to missing and empty array values.
1 parent 01f6433 commit 68ef50d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

source/reference/aggregation.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,16 +404,15 @@ The current pipeline operators are:
404404
:pipeline:`$group` pipeline operators.
405405

406406
- If you specify a target field for :pipeline:`$unwind` that
407-
does not exist in an input document, the document passes
408-
through :pipeline:`$unwind` unchanged.
407+
does not exist in an input document, the input document is
408+
ignored (generates no result documents).
409409

410410
- If you specify a target field for :pipeline:`$unwind` that is
411411
not an array, :mongodb:func:`aggregate()` generates an error.
412412

413413
- If you specify a target field for :pipeline:`$unwind` that
414-
holds an empty array (``[]``), then that field is removed
415-
from the result while all other fields are passed through
416-
unchanged.
414+
holds an empty array (``[]``) in an input document, the input
415+
document is ignored (generates no result documents).
417416

418417
.. pipeline:: $group
419418

0 commit comments

Comments
 (0)