Skip to content

Instantly share code, notes, and snippets.

@jam01
Last active May 25, 2017 16:00
Show Gist options
  • Save jam01/ea9566a00fd92dba1475cf689ea514ab to your computer and use it in GitHub Desktop.
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.
%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