What are the key DataWeave 2.0 functions and features?
Suggested answer
DataWeave 2.0 is MuleSoft's transformation language. Key functions: map: Transform each element of an array. filter: Keep elements matching a condition. reduce: Accumulate array to a single value. pluck: Convert object to array of key-value pairs. mapObject: Transform each key-value pair of an object. fun keyword: Define reusable named functions within a script. output directive: output application/json — defines the output MIME type. input directive: input payload application/xml — declares input type explicitly. using clause: Define local variables in expressions. ++: Merge operator for arrays and objects. payload.field??: Safe navigation — returns null if field is absent instead of error. default: payload.name default "Anonymous" — fallback for null values. Custom modules can be imported with import.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.