Last active
May 25, 2017 16:00
-
-
Save jam01/ea9566a00fd92dba1475cf689ea514ab to your computer and use it in GitHub Desktop.
Dataweave script that will take 2 arrays of maps and will output 1 array without duplicates. Used when needing to merge two arrays where one superseeds the other.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 1.0 | |
%output application/xml | |
--- | |
{ | |
mergedArray: (arrayWithNewValues ++ arrayWithOldValues) distinctBy $.id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment