skip to Main Content

Update element of an array if and only if data for element is present in new document mongodb

I have a problem while updating an array. sample document : _id:11, marksObtained:[{physics:10}, {chemistry:12}, {maths: 11}, {biology:9}, {social:9}] name:"Someone" field to update is: [{chemistry:13},{zoology:12}] So the new document looks like: _id:11, marksObtained:[{physics:10}, {chemistry:13}, {maths: 11}, {biology:9}, {social:9},{zoology:12}] name:"Someone" marks in…

VIEW QUESTION
Back To Top
Search