Delete matching values from an array.
Section: Arrays and positional updates
Remove array values
javascript
javascript
db.users.updateOne({ _id: 1 }, { $pull: { tags: "beta" } })Explanation
Useful for cleanup and preference toggles.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Arrays and positional updates
Update the first matching array element
Use the positional `$` operator.
Target specific nested elements with arrayFilters
Update matching array elements with named filters.