Skip to content

Update Document in Collection​

PATCH
/mongodb/collections/{collectionName}/documents/{documentId}

'Replace' one Document with the new document from Request in Collection. 404 for a document that does not exist (2.0.0).

Authorizations​

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

Parameters​

Path Parameters

collectionName*

The name of your MongoDb Collection

Type
string
Required
documentId*

DocumentId to update

Type
string
Required

Query Parameters

extendedJson

2.8.0 in the spec (read since 2.6.0): the mode of the document current of a version conflict (409, code 4092): relaxed (default) or canonical Extended JSON, or plain.

Type
string
Valid values
"relaxed""canonical""plain"

Request Body​

application/json
JSON
{
  
"additionalProperties": null
}

Responses​

application/json
JSON
{
  
"wasAcknowledged": true,
  
"upsertedIds": [
  
  
"string"
  
],
  
"modifiedCount": 0,
  
"matchedCount": 0
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI

Released under the MIT License.