Comparing Two Arrays Using Dataweave

While Dataweave 2.0 provides several out-of-the-box functions to transform the data, sometimes we need to orchestrate more than one such function to achieve the desired result. One such thing we often encounter is comparing two arrays and finding out the differences. Let's check out the different scenarios and see how we can achieve them.

Scenario 1: Comparing Two Arrays With Identical Structure

In this case, both arrays will have the same fields. If we want to see the items which are present in array 1 but not in array 2, we can use the "--" function.

CategoriesUncategorized