Delete Single Document
DELETE/collections/:collectionName/documents/:docId
Delete a single document by its _id. Uses the standard RESTful DELETE method. Returns 404 if the document does not exist.
Request
Path Parameters
collectionName stringrequired
Collection name
docId stringrequired
Document ID (supports both ObjectId strings and plain strings)
Query Parameters
transactionId string
Transaction ID
Responses
- 200
- 404
Delete successful
- application/json
- Schema
- Example (from schema)
- Example
Schema
deleted integer
Number of deleted documents
{
"deleted": 0
}
{
"deleted": 1
}
Document not found
- application/json
- Schema
- Example (from schema)
- Example
Schema
code string
Error code
message string
Error message
request_id string
Unique request ID
{
"code": "INVALID_PARAM",
"message": "param.query can't be empty",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
{
"code": "DOCUMENT_NOT_FOUND",
"message": "Document not found",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Loading...