deleteByQuery

Deletes documents matching the provided search query.


Query Syntax

HTTP

Copied to clipboard!
URL: http://kuzzle:7512/<index>/<collection>/_query
Method: DELETE
Body:
Copied to clipboard!
{
  "query": {
    // ...
  }
}

Other protocols

Copied to clipboard!
{
  "index": "<index>",
  "collection": "<collection>",
  "controller": "document",
  "action": "deleteByQuery",
  "body": {
    "query": {
      // ...
    }
  }
}

Arguments

  • collection: collection name
  • index: index name

Body properties


Response

Returns a ids array containing the list of deleted document identifiers.

Copied to clipboard!
{
  "status": 200,
  "error": null,
  "index": "<index>",
  "collection": "<collection>",
  "controller": "document",
  "action": "deleteByQuery",
  "requestId": "<unique request identifier>",
  "result": {
    "ids": [
      "id 1",
      "id 2",
      "id ...",
      "id n"
    ]
  }
}