Preview:
db.participantDietMealPlanDetails.updateMany({
    "mealPlan.dishVariation": "Milkshake",
	"_id":ObjectId("60d4258c4adb9a4b6fe4d99b")
},
    {
    $set: {
        "mealPlan.$[elem].dishVariation": "Milkshake",
        "mealPlan.$[elem].dishVariationId":  "660ea659e1645e032a289770",
        "mealPlan.$[elem].sizes": [{
                "calories": {
                    "value": "184",
                    "unit": "kcal"
                },
                "cookedWeight": "200",
                "name": "Medium Glass",
                "fat": {
                    "value": "5.0",
                    "unit": "gms"
                },
                "calcium": {
                    "value": "0.0",
                    "unit": "mg"
                },
                "iron": {
                    "value": "0.0",
                    "unit": "mg"
                },
                "fibre": {
                    "value": "0.0",
                    "unit": "mg"
                },
                "sodium": {
                    "value": "0.0",
                    "unit": "mg"
                },
                "sugars": {
                    "value": "0.0",
                    "unit": "mg"
                },
                "protein": {
                    "value": "4.7",
                    "unit": "gms"
                },
                "carbs": {
                    "value": "30.4",
                    "unit": "gms"
                }
            }
        ]

    }
}, {
    arrayFilters: [{
            "elem.dishVariation": "Milkshake"
        }
    ]
})
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter