Skip to content

Commit 6c0d20f

Browse files
clarify users cannot partially update object values
1 parent 3ca806f commit 6c0d20f

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

learn/engine/datatypes.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ The best way to work around this limitation is reformatting your data. The above
288288
]
289289
```
290290

291+
### Updating object fields
292+
293+
Object fields cannot be partially updated. Updating an object field with either the `PUT` or `POST` routes with an object fully replaces that value and removes any omitted subfields. Dot notation is also not supported when updating a document.
294+
291295
## Possible tokenization issues
292296

293297
Even if it behaves exactly as expected, the tokenization process may lead to counterintuitive results in some cases, such as:

reference/api/documents.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,15 @@ You can use this `taskUid` to get more details on [the status of the task](/refe
356356

357357
Add a list of documents or update them if they already exist. If the provided index does not exist, it will be created.
358358

359-
If you send an already existing document (same [document id](/learn/getting_started/primary_key#document-id)) the old document will be only partially updated according to the fields of the new document. Thus, any fields not present in the new document are kept and remain unchanged. Partial updates apply only to top-level fields: updating an object field replaces the entire object, removing any omitted subfields.
359+
If you send an already existing document (same [document id](/learn/getting_started/primary_key#document-id)) the old document will be only partially updated according to the fields of the new document. Any fields not present in the new document are kept and remain unchanged.
360+
361+
<Warning>
362+
Partial updates apply only to top-level fields. You cannot perform a partial update of a nested field.
363+
364+
Updating an object replaces the entire object and removes any omitted subfields.
365+
366+
Using dot notation in an update request creates a new flat attribute instead of updating the existing nested field.
367+
</Warning>
360368

361369
To completely overwrite a document, check out the [add or replace documents route](/reference/api/documents#add-or-replace-documents).
362370

0 commit comments

Comments
 (0)