map-groups
grouping →
map-groups(
expression: expression
) → grouping
Transforms each group’s value collection while preserving its key and position.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
expression | expression | Yes | The expression evaluated once against each group’s value collection. |
Argument evaluation
Visits each group in the incoming grouping and supplies its entire value collection to the expression.
expression: Evaluated once per group against that group’s entire value collection.
Examples
#{("BE" => {10, 20, 30}), ("FR" => {5, 15})} | map-groups(filter(greater-than(10))) → #{("BE" => {20, 30}), ("FR" => {15})}
#{("BE" => {10}), ("FR" => {20})} |#> filter(greater-than(15)) → #{("BE" => {}), ("FR" => {20})}
Kind: Function
Scope: grouping
Aliases: None