Reference sheet
Root resource
URI /
The root resource is the entry point of the data API.
Allowed Methods
Method | Description |
---|---|
GET | Returns the list of the databases |
Database
URI /<dbname>
Manage Databases.
Allowed Methods
Method | Description |
---|---|
GET | Returns the <dbname> database properties and the list of its collections and file buckets |
PUT | Creates or updates the database <dbname> |
PATCH | Updates the database <dbname> (only passed data) |
DELETE | Deletes the database <dbname> |
Collection
URI /<dbname>/<collname>
Manage MongoDB Collections.
Allowed Methods
Method | Description |
---|---|
GET | Returns the <collname> collection properties and the list of its documents |
PUT | Creates or updates the collection <collname> |
PATCH | Updates the collection <collname> (only passed data) |
POST | Creates or updates a document in the collection <collname> if data is a document. Bulk creates or updates several document in the collection if data is an array of documents. |
DELETE | Deletes the collection <collname> |
Indexes
The Indexes resource allows you to list the indexes of your collections.
URI /<dbname>/<collname>/_indexes
Allowed Methods
Method | Description |
---|---|
GET | Returns the indexes of the collection <collname> |
Index
The Index resource allows you to create the indexes of your collections.
URI /<dbname>/<collname>/_indexes/<indexid>
Allowed Methods
Method | Description |
---|---|
PUT | Creates the index <indexid> in the collection <collname> |
DELETE | Deletes the index <indexid> of the collection <collname> |
Document
The Document resource allows you to manage your documents.
URI /<dbname>/<collname>/<docid>
Allowed Methods
Method | Description |
---|---|
GET | Return the document <docid> |
PUT | Creates or updates the document <docid> |
PATCH | Updates the document <docid> (only passed data) Bulk update documents if <docid> is the wildcard character * (requires the filter query parameter) |
DELETE | Deletes the document <docid> Bulk deletes documents if is the wildcard character * (requires the filter query parameter) |
File buckets
The File bucket resource allows you to manage your files buckets, i.e. containers for binary files (GridFS).
URI /<dbname>/<bucketname>.files
Allowed Methods
Method | Description |
---|---|
GET | Returns the <bucketname> files bucket properties and the list of its files |
PUT | Creates or updates the files bucket <bucketname> |
POST | Creates a file in the bucket <bucketname> |
DELETE | Deletes the files bucket <bucketname> |
File
The File resource allows you to manage your files (GridFS).
File binaries are immutable: they cannot be modified. However since version 3.2 the json properties of a file can be modified.
URI /<dbname>/<bucketname>.files/<fileid>
Allowed Methods
Method | Description |
---|---|
GET | Returns the <fileid> file with link to download the binary data |
PUT | (multipart request, i.e.
|
PUT | (with Content-Type=application/json ) updates all the json properties of an existing file. |
DELETE | Deletes the file <fileid> in the files bucket <bucketname> |
PATCH | (with Content-Type=application/json ) Update the properties of an existing file that are part of the request body. |
Schema store
The schema store resource allows you to manage json schemas used in document validation. There can be a single schema store for each db.
URI /<dbname>/_schemas
Allowed Methods
Method | Description |
---|---|
GET | Returns the schema store properties and the paginated list of its schemas |
PUT | Upsert the schema store |
POST | Creates a schema in the schema store |
DELETE | Deletes the schema store |
Schema
The schema resource allows you to manage the json schemas used for validation.
The validation of the documents of a collection based on JSON schemas is enforced with the collection checker jsonSchema
Example
PATCH /db/coll { "checkers": [ { "name": "jsonSchema", "args": { "schemaId": "<schema_id>" } } ] }
More information in Request Checkers section.
URI /<dbname>/_schemas/<schemaid>
Allowed Methods
Method | Description |
---|---|
GET | Return the schema <schemaid> |
PUT | Creates or updates the schema <schemaid>. It must be a valid JSON schema according to JSON Schema Core Draft v4 specification. |
PATCH | Updates the schema <schemaid> (only passed data) |
DELETE | Deletes the schema <schemaid> |