Skip to main content

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

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryobjectYesInput value
toTransformer(##current)YesTransformer to apply on input
  • ##current - Current element

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"