replace #
Replaces the content of an existing document.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/<index>/<collection>/<documentId>/_replace[?refresh=wait_for]
Method: PUT
Body:
{
// new document content
}
Other protocols #
{
"index": "<index>",
"collection": "<collection>",
"controller": "document",
"action": "replace",
"_id": "<documentId>",
"refresh": "wait_for",
"body": {
// new document content
}
}
Arguments #
collection
: collection namedocumentId
: unique ID of the document to replaceindex
: index name
Optional: #
refresh
: if set towait_for
, Kuzzle will not respond until the new document content is indexed
Body properties #
New document content.
Response #
Returns an object containing updated document information, with the following properties:
_id
: document unique identifier_source
: new document content_version
: updated document version number
{
"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
}
}
Edit this page on Github(opens new window)