$$max
Returns the max of all values in the array
Usage​
{
"$$max": [ /* values */ ],
"by": /* Transformer */,
"type": /* type of values (to compare by) */,
"default": /* 0 */
}
"$$max([default],[type],[by]):{input}"
Returns​
BigDecimal
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | array | Yes | Array to sum | |
default | BigDecimal | 0 | The default value to use for empty values | |
by | Transformer(##current ) | Input is ##current (current element) | "##current" | A transformer to extract a property to sum by (using ##current to refer to the current item) |
type | Enum | auto /string /number /boolean | auto | Type of values to expect when ordering the input array |
Examples​
Input
Definition
Output
[4, -2, 13.45, null]
"$$max($$long:40):$"
40
[4, -2, 13.45, null]
"$$max(-8,NUMBER):$"
13.45
[4, -2, 13.45, null]
"$$max:$"
13.45
[4, -2, 13.45, null]
"$$max(z,STRING):$"
"z"
[
{ "value": 4 },
{ "value": 2 },
{ "value": 13.45 },
{ "value": null }
]
{
"$$max": "$",
"by": "##current.value",
"default":"zz",
"type":"STRING"
}
"zz"
[
{ "value": 4 },
{ "value": 2 },
{ "value": 13.45 },
{ "value": null }
]
{
"$$min": "$",
"by": "##current.value"
}
13.45