Skip to content

Suggested Validator​

GET
/mongodb/collections/{collectionName}/schema/validator

A $jsonSchema validator made of a sample of the documents (2.3.0): the BSON types per field, nested objects, array items and the required fields. Usable as validator of the collection options or of a declaration. 404 for a collection that does not exist.

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

Query Parameters

sampleSize

Number of documents that are analysed, 1000 by default (2.0.0; 1.x read every document); 0 reads every document. With a sample the counts and shares are estimates.

Type
integer
Example1000
Default
1000
Minimum
0
Format
"int32"
depth

How deep nested objects are analysed

Type
integer
Default
3
Format
"int32"
requiredThreshold

The share of the objects (0 to 1) a field has to be in to be required; 1 by default (in every object of the sample).

Type
number
Default
1
Minimum
0
Maximum
1
Format
"double"

Responses​

application/json
JSON
{
  
"validator": {
  
  
"additionalProperties": "string"
  
},
  
"count": 0,
  
"sample": 0,
  
"warnings": [
  
  
"string"
  
]
}

Playground​

Authorization
Variables
Key
Value

Samples​

Powered by VitePress OpenAPI

Released under the MIT License.