$$min
Returns the min of all values in the array
Usage​
{
"$$min": [ /* values */ ],
"by": /* Transformer */,
"type": /* type of values (to compare by) */,
"default": /* 0 */
}
"$$min([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]
"$$min($$long:-4):$"
-4
[4, -2, 13.45, null]
"$$min(-8,NUMBER):$"
"-8"
[4, -2, 13.45, null]
"$$min:$"
null
[4, -2, 13.45, null]
"$$min(z,STRING):$"
-2
[
{ "value": 4 },
{ "value": 2 },
{ "value": 13.45 },
{ "value": null }
]
{
"$$min": "$",
"by": "##current.value"
}
null
[
{ "value": 4 },
{ "value": 2 },
{ "value": 13.45 },
{ "value": null }
]
{
"$$min": "$",
"by": "##current.value",
"default": 1
}
1