MongoDB - Update field in an array object based on nested array's field value
问题 I am trying to update a field inside array of objects, where field in nested array is equal to a value. My goal here is to set the picture field a new url, where value field in valueList is oldRed Product schema: { variations: [{ id: 1, picture: 'https://example.picture.com', valueList: [{ name: 'color', value: 'oldRed' }, { name: 'size', value: 'M' }] }, { id: 2, picture: 'https://example.picture.com', valueList: [{ name: 'color', value: 'black' }, { name: 'size', value: 'M' }] }] } The