Update a nested element inside an array, lets say, the product “availability”.
Example structure
The “non-trivial” part of this solution is the need for the “$” operator:
<![CDATA[ (…) Query query = new Query(Criteria.where(“offers.offers.seller.name”).is(offer.getSeller().getName()) .and(“offers.offers.productId”).is(offer.getProductId())); update.set(“offers.offers.$.availability”, offer.getAvailability()); (…) ]]>
SyntaxHighlighter.highlight();