Files
elasticsearch-js/docs/reference-update.asciidoc
2024-12-05 14:46:52 -06:00

91 lines
4.4 KiB
Plaintext

[[reference-update]]
////////
===========================================================================================================================
|| ||
|| ||
|| ||
|| ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ ||
|| ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ ||
|| ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ ||
|| ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ||
|| ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ ||
|| ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ||
|| ||
|| ||
|| This file is autogenerated, DO NOT send pull requests that changes this file directly. ||
|| You should update the script that does the generation, which can be found in: ||
|| https://github.com/elastic/elastic-client-generator-js ||
|| ||
|| You can run the script with the following command: ||
|| npm run elasticsearch -- --version <version> ||
|| ||
|| ||
|| ||
===========================================================================================================================
////////
[discrete]
[[client.update]]
=== client.update
Update a document. Updates a document by running a script or passing a partial document.
{ref}/docs-update.html[{es} documentation]
[discrete]
==== Function signature
[source,ts]
----
(UpdateRequest, options?): Promise<UpdateResponse>
----
[discrete]
==== Request
[pass]
++++
<pre>
++++
interface UpdateRequest<TDocument = unknown, TPartialDocument = unknown> extends <<RequestBase>> {
id: <<Id>>
index: <<IndexName>>
if_primary_term?: <<long>>
if_seq_no?: <<SequenceNumber>>
lang?: string
refresh?: <<Refresh>>
require_alias?: boolean
retry_on_conflict?: <<integer>>
routing?: <<Routing>>
timeout?: <<Duration>>
wait_for_active_shards?: <<WaitForActiveShards>>
_source_excludes?: <<Fields>>
_source_includes?: <<Fields>>
detect_noop?: boolean
doc?: TPartialDocument
doc_as_upsert?: boolean
script?: <<Script>> | string
scripted_upsert?: boolean
_source?: <<SearchSourceConfig>>
upsert?: TDocument
}
[pass]
++++
</pre>
++++
[discrete]
==== Response
[pass]
++++
<pre>
++++
type UpdateResponse<TDocument = unknown> = <<UpdateUpdateWriteResponseBase>><TDocument>
[pass]
++++
</pre>
++++