Core
API v2.x
2

deleteFields #

Deletes fields of an existing document.


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/<index>/<collection>/<documentId>/_fields[?refresh=wait_for][&silent]
Method: DELETE
Body:
Copied to clipboard!
{
  "fields": [
    // path of fields to remove
  ]
}

Other protocols #

Copied to clipboard!
{
  "index": "<index>",
  "collection": "<collection>",
  "controller": "document",
  "action": "deleteFields",
  "_id": "<documentId>",
  "refresh": "wait_for",
  "body": {
    "fields": [
      // path of fields to remove
    ]
  }
}

Kourou #

Copied to clipboard!
kourou document:deleteFields <index> <collection> <body>
kourou document:deleteFields <index> <collection> <body> -a silent=true

Arguments #

  • collection: collection name
  • _id: unique ID of the document where the fields should be removed
  • index: index name

Optional: #

  • refresh: if set to wait_for, Kuzzle will not respond until the new document content is indexed
  • source: if set to true, the response will contain the new updated document
  • silent: if set, then Kuzzle will not generate notifications
    Available since 2.9.2

Body properties #

  • fields: an array of strings. Each string represents a path (see lodash path) to a specific field to remove

Response #

Returns an object containing updated document information, with the following properties:

  • _id: document unique identifier
  • _source: the new document content, if source is set to true
  • _version: updated document version number
Copied to clipboard!
{
  "status": 200,
  "error": null,
  "index": "<index>",
  "collection": "<collection>",
  "controller": "document",
  "action": "replace",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<documentId>",
    "_source": {
      // new document content
    },
    "_version": 13
  }
}