Unwind constructor
Creates $unwind
aggregation stage
field
- Field path to an array field.includeArrayIndex
- Optional. The name of a new field to hold the array index of the element.preserveNullAndEmptyArrays
- Optional. Iftrue
, if the path isnull
, missing, or an empty array,$unwind
outputs the document. Iffalse
,$unwind
does not output a document if the path isnull
, missing, or an empty array. The default value isfalse
.
Implementation
Unwind(Field field,
{String? includeArrayIndex, bool? preserveNullAndEmptyArrays})
: super(
'unwind',
AEObject({
'path': field,
if (includeArrayIndex != null)
'includeArrayIndex': includeArrayIndex,
if (preserveNullAndEmptyArrays != null)
'preserveNullAndEmptyArrays': preserveNullAndEmptyArrays
}));