Projection
Mpl supports array index range for array access. e.g., [2:4]
will index to array member 2 & 3 . If index is not specified as in, []
, range is implied as 0 to len of array. 'wildcard' can be used as key in map access which means any key at the specified level. The result of range or wildcard index results in a list of Json values. e.g.,
output is:
The type y
is a Json list of size 2. In this case, list vals are array value. Consequently, the list can be operated upon in bulk. For example one can use y
in an expression to change all the fields. e.g.,
output is:
A Json list can be converted to Json type by json
statement. e.g.,
output is:
In case of map the projection can be done via wildcard
. Mpl support unix glob syntax inside backtick. e..g, *bl*
. Simple wildcards, like '' or 'xy' can be specified withouth backtics. e.g.,
output is: