OptionaldocumentsThe list of partial document updates to apply. At most 1000 updates, or 96 on an index whose schema declares embed or sparse_embed. Mutually exclusive with filter, and with a non-empty set_fields or remove_fields.
maxItems states the general limit. A client that batches updates must size batches at 96 when any field of the index schema declares embed or sparse_embed.
OptionalfilterA metadata filter expression selecting the documents to patch with set_fields and remove_fields. Must not be empty; an empty filter is rejected rather than matching every document. Text-match operators ($match_phrase, $match_all, $match_any) are not supported here, since documents are selected on metadata alone. Mutually exclusive with documents.
OptionalremoveThe names of the fields to remove from every document matching filter. Only metadata fields can be removed here; data fields are refused, as in set_fields. When non-empty, only valid together with filter; an empty list asks for no change and is ignored.
OptionalsetThe fields to set on every document matching filter, and the values to set them to. Only metadata fields can be set here; every data field is refused, that is, vector fields, full-text-searchable text and embedded text, not only fields that declare embed or sparse_embed. Update those per ID with documents. When non-empty, only valid together with filter; an empty object asks for no change and is ignored.
The request for the
update_documentsoperation. Eitherdocumentsorfiltermust be specified, and they are mutually exclusive. Afiltermust be accompanied by a non-emptyset_fieldsand/orremove_fields.An empty
set_fieldsorremove_fieldsasks for no change, so it does not make a request by-filter: it is ignored, and a request that also hasdocumentsis still a valid per-ID update.A by-filter patch is checked against the index schema the same way a per-ID patch is: a value must match the type its field declares, a field cannot be both set and removed, and a required field cannot be removed.
Export
UpdateDocumentsRequest