thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Business Platforms & EA · Intermediate

DataWeave Function

Built-in or user-defined function in DataWeave, such as map, filter, reduce, pluck, groupBy, flatten and orderBy.

Definition

map iterates arrays with $ (item) and $$ (index); mapObject iterates object key-value pairs; pluck converts an object to an array; reduce accumulates; groupBy returns an object of arrays.

Example

[1,2,3] reduce ((item, acc = 0) -> acc + item)

Exam tip

map is for arrays, mapObject for objects; $$ is the index in map but the key in mapObject.

Related terms