truncate
Empties a collection by removing all its documents, while keeping any associated mapping.
Query Syntax
HTTP
URL: http://kuzzle:7512/<index>/<collection>/_truncate
Method: DELETE
Other protocols
{
"index": "<index>",
"collection": "<collection>",
"controller": "collection",
"action": "truncate"
}
Arguments
collection
: collection nameindex
: index name
Response
Returns a confirmation that the collection is being emptied:
{
"status": 200,
"error": null,
"action": "truncate",
"controller": "collection",
"index": "<index>",
"collection": "<collection>",
"requestId": "<unique request identifier>",
"result": {
"acknowledged": true,
}
}