Skip to main content

$$min

Returns the min of all values in the array

Usage​

{ 
"$$min": /* Array of elements */,
"default": /* any */,
"type": "AUTO" /* or STRING / NUMBER / BOOLEAN */,
"by": /* Transformer(##current) */
}
"$$min([default],[type],[by]):{input}"
note

Concrete values in the usage example are default values.

Returns​

object (Same as picked element)

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray of elements
defaultanynullThe default value to use for empty values
typeenumAUTO/ STRING/NUMBER/BOOLEANAUTOType of values to expect when ordering the input array
byTransformer(##current)nullA transformer to extract a property to compare by
  • ##current - Current element

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
[
{
"id": 1,
"value": 4
},
{
"id": 2,
"value": 2
},
{
"id": 3,
"value": 13.45
},
{
"id": 4,
"value": null
}
]
{
"$$min": "$",
"by": "##current.value"
}
{
"id": 4,
"value": null
}
[
{
"value": 4
},
{
"value": 2
},
{
"value": 13.45
},
{
"value": null
}
]
{
"$$min": "$",
"by": "##current.value",
"default": 3
}
{
"value": 2
}