I want to remove all the objects from the users array coming in remove array. Please correct my DataWeave code mentioned below. Expected output is also mentioned.
%dw 2.0
output application/json
var remove =[
{
"startDate": "2022-04-13",
"objectName": "Account"
}
]
var users = [{
"startDate": 20220412,
"objectName": "Account"
},
{
"startDate": 20220412,
"objectName": "Blanket Agreemt"
}
]
---
users filter ((item, index) -> item.objectName != value.objectName) map (value, key) -> {
"objectName": value.objectName
}
Expected output:
[{
"startDate": 20220412,
"objectName": "Blanket Agreemt"
}]