update_documents
Modify MongoDB documents with operator updates or aggregation pipelines, choosing first-match or multi-document updates and requiring confirmation for empty filters.
Instructions
Update with operators ({"$set": {...}, "$inc": {...}}) or an aggregation pipeline (JSON array). many=false updates the first match. An empty filter requires confirm_all=true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collection": "<collection>",
"filter": "<filter>",
"update": "<update>"
},
"name": "update_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| many | No | ||
| filter | Yes | ||
| update | Yes | ||
| upsert | No | ||
| database | No | ||
| collation | No | ||
| collection | Yes | ||
| connection | No | ||
| confirm_all | No | ||
| array_filters | No |