pub struct ForExpr {
pub intro: ForIntro,
pub key_expr: Option<Expression>,
pub value_expr: Expression,
pub grouping: bool,
pub cond: Option<ForCond>,
/* private fields */
}
Expand description
A for expression is a construct for constructing a collection by projecting the items from another collection.
Fields§
§intro: ForIntro
The for
expression introduction, containing an optional key var, value var and the
collection expression that is iterated.
key_expr: Option<Expression>
An expression that is evaluated once for each key in the source collection. If set, the
result of the for
expression will be an object. Otherwise, the result will be an array.
value_expr: Expression
An expression that is evaluated once for each value in the source collection.
grouping: bool
Indicates whether grouping mode is enabled. In grouping mode, each value in the resulting
object is a list of all of the values that were produced against each distinct key. This is
ignored if key_expr
is None
.
cond: Option<ForCond>
An optional filter expression. Elements for which the condition evaluates to true
will
be evaluated as normal, while if false
the element will be skipped.