update-many
Update all documents that match a filter in a MongoDB collection, applying update operators to multiple records in one operation. Include upsert to insert if no match.
Instructions
Updates all documents that match the specified filter for a collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider updating them in batches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | The selection criteria for the update, matching the syntax of the filter argument of db.collection.updateOne() | |
| update | Yes | An update document describing the modifications to apply using update operator expressions | |
| upsert | No | Controls whether to insert a new document if no documents match the filter | |
| database | Yes | Database name | |
| collection | Yes | Collection name |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | ||
| collection | Yes | ||
| upsertedId | No | ||
| matchedCount | Yes | ||
| modifiedCount | Yes | ||
| upsertedCount | Yes |