Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

--

--(Array<S>, Array<Any>): Array<S>

Returns a new array that removes every occurrence of elements listed in the right-hand side (rhs) array from the left-hand side (lhs) array. The result is that same as iteratively taking lhs - elementN, for each elementN in rhs.

When an element in the lhs array matches one of the values in the rhs array, it is removed. If multiple elements in the lhs array match a value, all matching values are removed from the lhs.

Transform

        
     
1
2
3
4
%dw 2.0
output application/json
---
a: [0, 1, 1, 2] -- [1,2]
Output

        
     
1
2
3
{
  "a": [0],
}
--({ (K)?: V }, Object): { (K)?: V }

Removes all the entries from the source that are present on the toRemove parameter.

Transform

        
     
1
2
3
4
5
6
7
%dw 2.0
output application/json
---
{
   hello: 'world',
   name: "DW"
 } -- {hello: 'world'}
Output

        
     
1
2
3
{
   "name": "DW"
}
--(Object, Array<String>)

Removes the properties from the source that are present the given list of keys.

Transform

        
     
1
2
3
4
5
6
7
%dw 2.0
output application/json
---
{
   hello: 'world',
   name: "DW"
 } -- ['hello']
Output

        
     
1
2
3
{
   "name": "DW"
}
--(Object, Array<Key>)

Removes the properties from the source that are present the given list of keys.

Transform

        
     
1
2
3
4
5
6
7
%dw 2.0
output application/json
---
{
   hello: 'world',
   name: "DW"
 } -- ['hello' as Key]
Output

        
     
1
2
3
{
   "name": "DW"
}