What behavior would this Mongo query have - double nested documents

Following up on my previous answer.

Thanks to @Aasawari’s reply in another thread, I realized that the confusion might come from the fact there is another array update positional operator to only update the first element that match the query.

$ - to update the first matching element
$[] - to update all the matching element
$[name] - to update all the matching element based on arrayFilters.

4 Likes