delete #
Deletes a document.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/<index>/<collection>/<documentId>[?refresh=wait_for][&source][&silent]
Method: DELETE
Other protocols #
{
"index": "<index>",
"collection": "<collection>",
"controller": "document",
"action": "delete",
"_id": "<documentId>"
}
Kourou #
kourou document:delete <index> <collection> <id>
kourou document:delete <index> <collection> <id> -a silent=true
Arguments #
collection
: collection name_id
: document unique identifierindex
: index name
Optional: #
refresh
: if set towait_for
, Kuzzle will not respond until the deletion has been indexedsource
: if set totrue
Kuzzle will return the deleted document body in the response.silent
: if set, then Kuzzle will not generate notificationsAvailable since 2.9.2
Response #
Returns information about the deleted document:
_id
: document unique identifier_source
: deleted document source, only if optionsource
is set totrue
{
"status": 200,
"error": null,
"index": "<index>",
"collection": "<collection>",
"controller": "document",
"action": "delete",
"requestId": "<unique request identifier>",
"result": {
"_id": "<documentId>",
"_source": "<deleted document>" // If `source` option is set to true
}
}
Edit this page on Github(opens new window)