# update with condition

To update an item object in an array of objects, you can write the value key of the object you want to update.

```javascript
dispatch(update('DESTINATION',CONDITION-VALUE,CONDITION-KEY))
```

**Example:** Update `Users` with `id=2`

```javascript
dispatch(update('Users', { name: "Crawfish Lover" }, 2, 'id'))
```

<figure><img src="https://2096029297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa8hQdsN7Pv00B1Pt9tuc%2Fuploads%2FaNbyEBQVQVXmxhQYi6pN%2F68747470733a2f2f766e73656174746c652e636f6d2f64796e616d6963526564756365722f5570646174655573657273496e41727261792e706e67.png?alt=media&#x26;token=2ee887fa-4d68-437a-bb2a-1b5640405142" alt=""><figcaption></figcaption></figure>

<br>

\ <br>

<br>
