toArrayExpression method
This pipeline as an expression that evaluates to the array of its results, for use in a stage of another pipeline (a subquery).
A pipeline that outputs a single field yields an array of the values of that field; otherwise every element is a map of the fields of a result.
Implementation
Expression toArrayExpression() => FunctionExpression('array', <Object?>[
RawValueExpression(_toPipelineValue, toString()),
]);