From 68ef50dbca93df330303e3f3445d119dc0066511 Mon Sep 17 00:00:00 2001 From: astaple Date: Fri, 13 Jul 2012 16:54:37 -0700 Subject: [PATCH] SERVER-6131 Describe new behavior when $unwind is applied to missing and empty array values. --- source/reference/aggregation.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/reference/aggregation.txt b/source/reference/aggregation.txt index 7aeb426f2eb..f96fa317770 100644 --- a/source/reference/aggregation.txt +++ b/source/reference/aggregation.txt @@ -404,16 +404,15 @@ The current pipeline operators are: :pipeline:`$group` pipeline operators. - If you specify a target field for :pipeline:`$unwind` that - does not exist in an input document, the document passes - through :pipeline:`$unwind` unchanged. + does not exist in an input document, the input document is + ignored (generates no result documents). - If you specify a target field for :pipeline:`$unwind` that is not an array, :mongodb:func:`aggregate()` generates an error. - If you specify a target field for :pipeline:`$unwind` that - holds an empty array (``[]``), then that field is removed - from the result while all other fields are passed through - unchanged. + holds an empty array (``[]``) in an input document, the input + document is ignored (generates no result documents). .. pipeline:: $group