curl --request PUT \
--url https://api.example.com/{collection}/batch \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
{}
],
"filter": {},
"update": {}
}
'{
"matched": 123,
"modified": 123,
"failed": [
{}
],
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Update multiple documents matching IDs or filter criteria
curl --request PUT \
--url https://api.example.com/{collection}/batch \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
{}
],
"filter": {},
"update": {}
}
'{
"matched": 123,
"modified": 123,
"failed": [
{}
],
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KTS-o7/permission-mongo/llms.txt
Use this file to discover all available pages before exploring further.
ids or filter must be provided.Maximum: 1000 IDs (configurable)ids or filter must be provided.{
"ids": [
"65f1a2b3c4d5e6f7a8b9c0d1",
"65f1a2b3c4d5e6f7a8b9c0d2",
"65f1a2b3c4d5e6f7a8b9c0d3"
],
"update": {
"status": "active",
"verified": true
}
}
{
"filter": {
"department": "Engineering",
"status": "pending"
},
"update": {
"status": "active",
"approved_at": "2024-03-15T10:30:00Z"
}
}
{
"matched": 15,
"modified": 12
}
updated_at: Current UTC timestampupdated_by: Authenticated user’s IDhandlers_batch.go:427-428
deny_write list. The operation is rejected if any denied field is included in the update.
From handlers_batch.go:363-373
handlers_batch.go:414-424
handlers_batch.go:408-411
filter parameter supports MongoDB query operators:
{
"filter": {
"age": { "$gte": 18 },
"status": { "$in": ["active", "pending"] },
"created_at": { "$lt": "2024-01-01T00:00:00Z" }
},
"update": {
"category": "adult"
}
}
$eq, $ne: Equal, not equal$gt, $gte, $lt, $lte: Comparison operators$in, $nin: Array membership$and, $or, $not: Logical operators$exists: Field existence checkupdate permission for the collectionids parametercollection_not_found: Collection does not existforbidden: User lacks update permission or attempts to modify denied fieldsbad_request: Invalid request (missing ids/filter, empty update, invalid IDs)internal_error: Database operation failed{
"error": {
"code": "forbidden",
"message": "You don't have permission to modify this field",
"details": {
"field": "salary"
}
}
}
pkg/api/handlers_batch.go:302-459