A document by its _id
The A document by its _id routes of the REST API, with an example of each.
Operations
Reads the document of one _id or changes it with a replace, an update or a delete. The _id goes in the path in Extended JSON when it is not a string.
GET /v1/databases/{db}/collections/{coll}/documents/{id}
Equivalent to MongoDB's find command.
| Path parameters | dbcollid |
| Body | None |
| Responses | 200, default |
Shell
curl https://<node>:27080/v1/databases/{db}/collections/{coll}/documents/{id} \
-H "Authorization: Bearer $TESELADB_API_KEY"PUT /v1/databases/{db}/collections/{coll}/documents/{id}
Equivalent to MongoDB's update command.
| Path parameters | dbcollid |
| Body | JSON, canonical Extended JSON or BSON |
| Responses | 200, default |
Shell
curl -X PUT https://<node>:27080/v1/databases/{db}/collections/{coll}/documents/{id} \
-H "Authorization: Bearer $TESELADB_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'PATCH /v1/databases/{db}/collections/{coll}/documents/{id}
Equivalent to MongoDB's update command.
| Path parameters | dbcollid |
| Body | JSON, canonical Extended JSON or BSON |
| Responses | 200, default |
Shell
curl -X PATCH https://<node>:27080/v1/databases/{db}/collections/{coll}/documents/{id} \
-H "Authorization: Bearer $TESELADB_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'DELETE /v1/databases/{db}/collections/{coll}/documents/{id}
Equivalent to MongoDB's delete command.
| Path parameters | dbcollid |
| Body | None |
| Responses | 200, default |
Shell
curl -X DELETE https://<node>:27080/v1/databases/{db}/collections/{coll}/documents/{id} \
-H "Authorization: Bearer $TESELADB_API_KEY"