Skip to content

Create Collection​

PUT
/mongodb/collections/{collectionName}

Create a Collection with options: capped (capped, sizeInBytes, maxDocuments), a validator (validator, validationLevel off, moderate or strict, validationAction error or warn) and a collation. Without a body an empty Collection is created. The administrate grant for the name is needed; a name of another database is database:name. An existing Collection is a conflict (409), reserved names (system collections, the prefix of the server, the collections of a bucket) and options that do not fit are 400.

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
{
  
"name": "string"
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI

Released under the MIT License.