$$max
Returns the max of all values in the array
Usage​
{
"$$max": /* Array of elements */,
"default": /* any */,
"type": "AUTO" /* or STRING / NUMBER / BOOLEAN */,
"by": /* Transformer(##current) */
}
"$$max([default],[type],[by]):{input}"
note
Concrete values in the usage example are default values.
Returns​
object
(Same as picked element
)
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | array | Yes | Array of elements | |
default | any | null | The default value to use for empty values | |
type | enum | AUTO / STRING /NUMBER /BOOLEAN | AUTO | Type of values to expect when ordering the input array |
by | Transformer(##current ) | null | A transformer to extract a property to compare by
|
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"
[
{
"id": 1,
"value": 4
},
{
"id": 2,
"value": 2
},
{
"id": 3,
"value": 13.45
},
{
"id": 4,
"value": null
}
]
{
"$$max": "$",
"by": "##current.value",
"default": "zz"
}
{
"id": 3,
"value": 13.45
}
[
{
"value": 4
},
{
"value": 2
},
{
"value": 13.45
},
{
"value": null
}
]
{
"$$max": "$",
"by": "##current.value"
}
{
"value": 13.45
}