ArrayGroupBy
Alias:ArrayGroupBy
, Group
Output:Array of Entity
Group elements in an array or entities in a stream using a function. Entities in the resulting array will have two properties Key
and Values
. The Key
will be set according to the result of the function.
Parameter | Type | Required | Position | Summary |
---|---|---|---|---|
Array | array<T> | ✔ | 1 | The array or entity stream to group |
Function By Using | T | ✔ | 2 | A function to use to group entities |
Examples​
SCL​
Group Array: [
('type': 'A', 'value': 1)
('type': 'B', 'value': 2)
('type': 'A', 'value': 3)
] Using: (<item>['type'])
Expected Output​
[('Key': "A" 'Values': [('type': "A" 'value': 1), ('type': "A" 'value': 3)]), ('Key': "B" 'Values': [('type': "B" 'value': 2)])]