Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const saveData = await Student.findOne(
- {
- userId,
- "academicInfo.class":className,
- "academicInfo.isActive": true,
- "academicInfo.isDeleted": false,
- _id,
- "academicInfo.examDetails": {
- $elemMatch : {
- examType: examType,
- examSubject: subject,
- totalMarks: totalMark
- } //query the data from data base
- }
- } //query part
- {
- $set : {
- "examDetails.$.result.$.totalMark": totalMark,
- "examDetails.$.result.$.marks": myMark,
- "examDetails.$.result.$.rightAnswer": rightAnswer,
- "examDetails.$.result.$.wrongAnswer": wrongAnswer
- }
- }, //update part
- {} //option
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement