$$transform
Applies a transformation inside a transformer (Useful for piping functions results)
Usage​
{
"$$transform": /* Input value */,
"to": /* Transformer(##current) */
}
"$$transform(<to>):{input}"
Returns​
Transformed value
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | object | Yes | Input value | |
to | Transformer(##current ) | Yes | Transformer to apply on input
|
Examples​
Input
Definition
Output
{
"value": 5,
"item": {
"foo": "aaa",
"id": "bbb"
}
}
{
"$$transform": "$.item",
"to": {
"id": "##current.id",
"map_foo": "##current.foo",
"value": "$.value"
}
}
{
"id": "bbb",
"map_foo": "aaa",
"value": 5
}
"a,b"
{
"$$transform": "$$split(','):$",
"to": {
"left": "##current[0]",
"right": "##current[1]"
}
}
{
"left": "a",
"right": "b"
}
"ab"
"$$transform(##current[0]):$$split:$"
"a"