3.8`$` shorthand
DataWeave lets you write:
payload map {
customerId: $.id,
companyName: $.name
}
Here:
$
means:
current item
and:
$$
typically means:
current index/key depending on context
So:
payload map {
index: $$,
id: $.id
}
might produce:
[
{
"index": 0,
"id": "1"
},
{
"index": 1,
"id": "2"
}
]
For interview coding, I prefer the explicit syntax initially:
payload map (customer) -> ...
It's easier to reason about.