MongoDB icon

MongoDB

MongoDB custom node with singleton pooling, insert if not exists, update operators and advanced querying

Update One

AI-generated

Summary

Update a single document in a specified MongoDB collection by applying $set and/or $inc operations according to provided filters and field values.

Inputs

  • Database (required) — MongoDB database name to connect to.
  • Collection (required) — MongoDB collection name where the document to update resides.
  • Filter (required) — Filter criteria to select the document to update.
  • Set Fields — Fields and values to update using the MongoDB $set operator.
  • Increment Fields — Numeric fields and values to increment using the MongoDB $inc operator.

Output shape

A list of objects, each indicating the number of documents matched and modified by the update operation.

The output for each input item includes 'matched' (matchedCount) and 'modified' (modifiedCount) fields reflecting the update operation results. Only one document is updated per operation.

Links

Discussion