Skip to main content

$$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​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray to sum
defaultBigDecimal0The default value to use for empty values
byTransformer(##current)Input is ##current (current element)"##current"A transformer to extract a property to sum by (using ##current to refer to the current item)
typeEnumauto/string/number/booleanautoType 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