Skip to content

Change the Validation of a Collection​

PATCH
/mongodb/collections/{collectionName}/options

Change the validator, the validationLevel and the validationAction of a Collection (collMod), the answer is the options after the change. A capped Collection and the collation cannot be changed after the creation (400). The administrate grant is needed.

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

Request Body​

application/json
JSON
{
  
"capped": true,
  
"sizeInBytes": 0,
  
"maxDocuments": 0,
  
"validator": {
  
  
"additionalProperties": null
  
},
  
"validationLevel": "string",
  
"validationAction": "string",
  
"collation": {
  
  
"locale": "string",
  
  
"strength": 0,
  
  
"caseLevel": true,
  
  
"numericOrdering": true
  
}
}

Responses​

application/json
JSON
{
  
"capped": true,
  
"sizeInBytes": 0,
  
"maxDocuments": 0,
  
"validator": {
  
  
"additionalProperties": null
  
},
  
"validationLevel": "string",
  
"validationAction": "string",
  
"collation": {
  
  
"locale": "string",
  
  
"strength": 0,
  
  
"caseLevel": true,
  
  
"numericOrdering": true
  
}
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI

Released under the MIT License.