Contact Free trial Login

Arrays (dw::core::Arrays)

This module contains helper functions for working with arrays.

To use this module, you must import it to your DataWeave code, for example, by adding the line import * from dw::core::Arrays to the header of your DataWeave script.

Functions

Name Description

countBy

Counts the elements in an array that match the results of a function.

divideBy

Breaks up an array into sub-arrays that contain the specified number of elements.

drop

Drops the first n elements. It returns the original array when n <= 0 and an empty array when n > sizeOf(array).

dropWhile

Drops elements from the array while the condition is met.

every

Returns true if every element in the array matches the condition.

indexOf

Returns the index of the first occurrence of an element within the array.

indexWhere

Returns the index of the first occurrence of an element that matches a condition within the array.

join

Joins two arrays of objects by a given ID criteria.

leftJoin

Joins two arrays of objects by a given ID criteria.

outerJoin

Joins two array of objects by a given ID criteria.

partition

Separates the array into the elements that satisfy the condition from those that do not.

slice

Selects the interval of elements that satisfy the condition: from <= indexOf(array) < until

some

Returns true if an element in the array matches the specified condition.

splitAt

Splits an array into two at a given position.

splitWhere

Splits an array into two at the first position where the condition is met.

sumBy

Returns the sum of the values of the elements in an array.

take

Selects the first n elements. It returns an empty array when n <= 0 and the original array when n > sizeOf(array).

takeWhile

Selects elements from the array while the condition is met.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.