Skip to content

SQL Reference

UPDATEONE

db.collection.updateOne(filter, update, options)

Section titled “db.collection.updateOne(filter, update, options)”
  • filter: The selection filter for the document to update.
  • update: Update operators, or an aggregation pipeline, describing the changes.
  • options: Optional settings such as upsert and arrayFilters.
db.users.updateOne({ _id: 1 }, { $set: { active: false } })