truncate

Since Kuzzle v1.0.0

URL: http://kuzzle:7512/<index>/<collection>/_truncate
Method: DELETE

Query

{
  "index": "<index>",
  "collection": "<collection>",
  "controller": "collection",
  "action": "truncate"
}

Response

{
  "status": 200,
  "error": null,
  "action": "truncate",
  "controller": "collection",
  "index": "<index>",
  "collection": "<collection>",
  "requestId": "<unique request identifier>",
  "result": {
    "acknowledged": true,
  }
}

Empties a collection from all its documents, while keeping any associated mapping.
It is also faster than deleting all documents from a collection using a query.