mDelete #
Deletes multiple documents.
The number of documents that can be deleted by a single request is limited by the documentsWriteCount
server configuration (see the Configuring Kuzzle guide).
Query Syntax #
HTTP #
URL: http://kuzzle:7512/<index>/<collection>/_mDelete[?refresh=wait_for][&silent]
Method: DELETE
Body:
{
"ids": ["<documentId>", "<anotherDocumentId>"]
}
Other protocols #
{
"index": "<index>",
"collection": "<collection>",
"controller": "document",
"action": "mDelete",
"body": {
"ids": ["<documentId>", "<anotherDocumentId>"]
}
}
Kourou #
kourou document:mDelete <index> <collection> <body>
kourou document:mDelete <index> <collection> <body> -a silent=true
Arguments #
collection
: collection nameindex
: index name
Optional: #
refresh
: if set towait_for
, Kuzzle will not respond until the deletions are indexedsilent
: if set, then Kuzzle will not generate notificationsAvailable since 2.9.2strict
: if set, an error will occur if at least one document has not been deletedAvailable since 2.11.0
Body properties #
ids
: an array of document identifiers to delete
Response #
Returns an object containing 2 arrays: successes
and errors
The successes
array contain the successfuly deleted document IDs.
Each deletion error is an object of the errors
array with the following properties:
_id
: document IDreason
: human readable reason
If strict
mode is enabled, will rather return an error if at least one document has not been deleted.
{
"status": 200,
"error": null,
"index": "<index>",
"collection": "<collection>",
"action": "mDelete",
"controller": "document",
"requestId": "<unique request identifier>",
"result": {
"successes": ["<documentId>"],
"errors": [
{
"_id": "anotherDocumentId",
"reason": "cannot find document"
}
]
}
}
Edit this page on Github (opens new window)