Домой United States USA — software Dataweave Exercise: Filter Like Functions in Arrays Module — Part 1

Dataweave Exercise: Filter Like Functions in Arrays Module — Part 1

167
0
ПОДЕЛИТЬСЯ

Today, I am going to show you how to use a few functions in the arrays module that are similar to but not equivalent to the filter function.
Join the DZone community and get the full member experience. Functions are divided into modules in dataweave, just as methods are divided into packages in Java. Today I’ll show you how to use a few functions in the arrays module that are similar to but not equivalent to the filter function. Arrays module functions that we are going to discuss are drop, dropWhile, which are introduced in the dataweave 2.2.0 version. The reason for comparing these functions to filter is that, just like filter, they also operate on an array to produce the desired result based on some criteria. To use functions from the Arrays module in dataweave code we should import them at header section as below: import * from dw::core::Arrays Similarly, if you want to use functions from other modules, you can do so: import * from dw::core:://module name// Just at the end module name changes.

Continue reading...