---
schema_version: "1"
id: a50f92a677f6e2e5f76f9c0d088d902ced0136d5ce8019d41712e53cc48af1a5
title: --
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-core-functions-minusminus.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-core-functions-minusminus
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7a29ed5de12d650d6d32b2c9ec8c4e93ac0589b83a0873aa460838707f215f65
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# \--

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

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

Removes specified values from an input value.

This version of `--` removes all instances of the specified items from an array. Other versions act
on objects, strings, and the various date and time formats that are supported by DataWeave.

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Name</p></td><td><p>Description</p></td></tr><tr><td><p><code>source</code></p></td><td><p>The array containing items to remove.</p></td></tr><tr><td><p><code>toRemove</code></p></td><td><p>Items to remove from the source array.</p></td></tr></tbody></table>

### Example

This example removes specified items from an array. Specifically, it removes all instances of the
items listed in the array on the right side of `--` from the array on the left side of the function,
leaving `[0]` as the result.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ "a" : [0, 1, 1, 2] -- [1,2] }
```

#### Output

```JSON
{ "a": [0] }
```

## \--({ (K)?: V }, Object): { (K)?: V }

Removes specified key-value pairs from an object.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>source</code></p></td><td><p>The source object (an <code>Object</code> type).</p></td></tr><tr><td><p><code>toRemove</code></p></td><td><p>Object that contains the key-value pairs to remove from the source object.</p></td></tr></tbody></table>

### Example

This example removes a key-value pair from the source object.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ "hello" : "world", "name" : "DW" } -- { "hello" : "world"}
```

#### Output

```JSON
{ "name": "DW" }
```

## \--(Object, Array<String>)

Removes all key-value pairs from the source object that match the specified search key.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>source</code></p></td><td><p>The source object (an <code>Object</code> type).</p></td></tr><tr><td><p><code>toRemove</code></p></td><td><p>An array of keys to specify the key-value pairs to remove from the source object.</p></td></tr></tbody></table>

### Example

This example removes two key-value pairs from the source object.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"]
```

#### Output

```JSON
{ "good": "bad" }
```

## \--(Object, Array<Key>)

Removes specified key-value pairs from an object.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>source</code></p></td><td><p>The source object (an <code>Object</code> type).</p></td></tr><tr><td><p><code>keys</code></p></td><td><p>A keys for the key-value pairs to remove from the source object.</p></td></tr></tbody></table>

### Example

This example specifies the key-value pair to remove from the source object.

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ "hello" : "world", "name" : "DW" } -- ["hello" as Key]
```

#### Output

```JSON
{ "name": "DW" }
```
