Main points:
- DataWeave 2.0 provides mapping capabilities
- Java and DataWeave can achieve the same mappings
- DataWeave mapping function is less verbose than Java
DataWeave map function
The DataWeave 2.0 (Mule 4) map function shares similarities with the map
() method from Java’s Stream
class.
Mapping is a transformative operation
The idea of mapping is to transform each element of an array and output a new array of transformed elements. An expression is provided that performs the transformation. It is applied to each element in the array and collected into another new array.