# $push and $pull

*noun*

say it: **“DOL-er PUSH and DOL-er PULL”** **/ˈdɑlər ˈpʊʃ ənd ˈdɑlər ˈpʊl/**

Two MongoDB update operators for arrays: $push adds an item to the end, and $pull removes every item equal to a value.

## What do **$push and $pull** do in a MongoDB update?

**$push** adds an item to the end of an array field, even when the array already holds it, and **$pull** removes every item equal to the value you give. Both change the array in place, without rewriting the document.

```javascript
db.recipes.updateOne({ _id: 4 }, { $push: { tags: "weeknight" } });
db.recipes.updateOne({ _id: 4 }, { $pull: { tags: "spicy" } });
db.recipes.findOne({ _id: 4 }).tags;
// [ 'vegan', 'weeknight' ]
```

## In a sentence

- “**$push and $pull** change one array inside a document without sending the whole document back.”
- “The cookbook app uses **$push and $pull** to add tags to a recipe and take them off again.”

Level: Apprentice · [More MongoDB terms at this level](https://www.ask-codey.com/glossary?category=mongodb&level=2)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/push-and-pull
