update_many
Update all MongoDB documents matching a filter. Use update operators like $set or $inc; optionally insert a new document with upsert if none match.
Instructions
Perbarui SEMUA dokumen yang cocok dengan filter menggunakan operator update.
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>"
},
"name": "update_many"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Query filter MongoDB. Contoh: {"status": "aktif", "umur": {"$gt": 25}}. Kirim sebagai objek atau string JSON. Gunakan {} untuk semua dokumen. | |
| update | No | Dokumen update MongoDB. Gunakan operator seperti {"$set": {"umur": 31}} atau {"$inc": {"counter": 1}}. Tanpa operator akan otomatis dibungkus "$set". | |
| upsert | No | Jika true, dokumen baru dibuat bila tidak ada yang cocok dengan filter (default false). | |
| database | No | Nama database tujuan. Opsional jika MONGODB_DB sudah diatur. | |
| collection | Yes | Nama koleksi. |