filter-groups
grouping →
filter-groups(
predicate: predicate
) → grouping
Keeps whole groups whose group-level predicate evaluates to true.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
predicate | predicate | Yes | The predicate evaluated once against each group, with its key and value collection available. |
Argument evaluation
Visits each group, including its key and values, in the grouping entering this call.
predicate: Evaluated once per visited group, with its key and values available in the context.
Examples
#{("BE" => {1, 2}), ("FR" => {3})} | filter-groups($value | cardinality | greater-than(1)) → #{("BE" => {1, 2})}
#{("BE" => {1}), ("FR" => {2})} | having($key | is-equivalent-to("FR")) → #{("FR" => {2})}
Kind: Function
Scope: grouping
Aliases: having