Skip to content

Several Writes in one Request​

POST
/mongodb/batch

Inserts, replaces, partial updates and deletes of documents of any collections in one request (2.10.0). Every operation is checked like its own route (grants, access rules, hooks, validation, behaviours). With atomic (default) all operations run in one transaction, all or nothing; it needs a replica set or a sharded cluster (501, code 5012 otherwise). With atomic: false they run one after another and each result is reported (an error stops nothing). At most 1000 operations (413, code 4134).

Authorizations​

httpAuth
Type
HTTP (bearer)
or
httpAuth1
Type
HTTP (basic)
or
apiKeyAuth
Type
API Key (header: X-AUTH-APIKEY)

Request Body​

application/json
JSON
{
  
"atomic": true,
  
"operations": [
  
  
{
  
  
  
"op": "insert",
  
  
  
"collection": "string",
  
  
  
"id": "string",
  
  
  
"document": {
  
  
  
  
"additionalProperties": "string"
  
  
  
}
  
  
}
  
]
}

Responses​

The result of every operation in the order of the request.

application/json
JSON
{
  
"atomic": true,
  
"results": [
  
  
{
  
  
  
"ok": true,
  
  
  
"insertedId": "string",
  
  
  
"matchedCount": 0,
  
  
  
"modifiedCount": 0,
  
  
  
"deletedCount": 0,
  
  
  
"error": {
  
  
  
  
"code": 0,
  
  
  
  
"msg": "string",
  
  
  
  
"additionalInfo": "string",
  
  
  
  
"issues": [
  
  
  
  
  
{
  
  
  
  
  
  
"path": "string",
  
  
  
  
  
  
"message": "string"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"current": {
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
}
  
  
}
  
]
}

Playground​

Authorization
Body

Samples​

Powered by VitePress OpenAPI

Released under the MIT License.