Unwind constructor

Unwind(
  1. Field field, {
  2. String? includeArrayIndex,
  3. bool? preserveNullAndEmptyArrays,
})

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. If true, if the path is null, missing, or an empty array, $unwind outputs the document. If false, $unwind does not output a document if the path is null, missing, or an empty array. The default value is false.

Implementation

Unwind(Field field,
    {String? includeArrayIndex, bool? preserveNullAndEmptyArrays})
    : super(
          'unwind',
          AEObject({
            'path': field,
            if (includeArrayIndex != null)
              'includeArrayIndex': includeArrayIndex,
            if (preserveNullAndEmptyArrays != null)
              'preserveNullAndEmptyArrays': preserveNullAndEmptyArrays
          }));