The location of the desired content relative to the current $$ROOT.
The location of the desired content relative to the current $$ROOT.
Various transformations (merging, conversion to Workflow, etc.) combine structures that we need to be able to extract later. This tells us how to extract them.
Like ValueBuilder, this is a Leaf node which can be used to construct a more complicated WorkflowBuilder.
Like ValueBuilder, this is a Leaf node which can be used to construct a more complicated WorkflowBuilder. Takes a value resulting from a Workflow and wraps it in a WorkflowBuilder. For example: If you want to read from MongoDB and then project on a field, the read would be the CollectionBuilder.
Name, or names under which the values produced by the src will
be found. It's most often Root
, or else it's probably a
temporary Field
.
In the case of read, it's None. In the case where we are
converting a WorkflowBuilder into a Workflow, we have access
to the shape of this Workflow and encode it in struct
.
Same as an ExprBuilder
but contains the shape of the resulting query.
Same as an ExprBuilder
but contains the shape of the resulting query.
The result is a document that maps the field Name to the resulting values
from applying the Expr
associated with that name.
NB: The shape is more restrictive than $project because we may need to
convert it to a GroupBuilder
, and a nested Reshape
can be realized
with a chain of DocBuilders, leaving the collapsing to
Workflow.coalesce.
Either arbitrary javascript expression or Pipeline expression An arbitrary javascript is more powerful but less performant because it gets materialized into a Map/Reduce operation.
A query that applies an Expr
operator to a source (which could be
multiple values).
A query that applies an Expr
operator to a source (which could be
multiple values). You can think of Expr
as a function application in
MongoDB that accepts values and produces new values. It's kind of like a
map. The shape coming out of an ExprBuilder
is unknown because of the
fact that the expression can be arbitrary.
The values on which to apply the Expr
The expression that produces a new set of values given a set of values.
The content is nested in a field under $$ROOT.
The content is already at $$ROOT.
If we know what the shape is, represents the list of Fields.
For instance, $match, $skip, $limit, $sort
Holds a partially-unknown structure.
Holds a partially-unknown structure. Expr
entries are unknown and Doc
entries are known. There should be at least one Expr in the list,
otherwise it should be a DocBuilder.
The content is a subset of the document at $$ROOT.
A query that produces a constant value.
A partial description of a query that can be run on an instance of MongoDB
Simplify/coalesce certain shapes, eliminating extra layers that make it harder to pattern match.
Simplify/coalesce certain shapes, eliminating extra layers that make it
harder to pattern match. Should be applied before objectConcat
,
arrayConcat
, or merge
.