DataWeave - newgeekorder/TechWiki GitHub Wiki

Links and Reference

Notes

map map and mapObject functions to iterate through the input

  • map to go through the elements in the "books" array.
  • mapObject to go through the keys and values in each of the objects of the array and do something For example
%dw 2.0
output application/json
---
items: payload.books map (item, index) -> {
      book: item mapObject (value, key) -> {
      (upper(key)): value
      }
}

the groovy closest equivalent would be

list/object.foreach{ key, value ->
// do something 
}

**p()* get properties https://docs.mulesoft.com/dataweave/2.3/dw-mule-functions-p
R3n?*tgR8B;81>3x