Updating one nested object

I have an index of documents containing an array of objects (nested). I am aware that the normal way to update this would be to query to get the array, update the object I want to update, then replace the entire array in a partial update.

There are occasions where a lot of updates will be happening to the nested objects, so I don't want to update the entire array, in case the query for a second update happens just before the update for the first update.

Is it possible to only update one nested object in the array, without replacing the others as well?

No matter what you update in a nested document, all parts of it are reindexed behind the scenes. Frequent updates to large nested documents can therefore get very expensive.

These updates aren't really frequent, it's just that when one update happens, others are likely to happen at the same time. Most of the time there are no updates at all.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.