my schema is like this
{
_id : Default id,
"name" : "utk",
email : "kap@gmail.com",
scores: [
{examname : "english", score : 50},
{examname : "hindi" ,score : 59}
]
}
i have to perform update on basis of email and examname of particular document lets say i have to update score to 90 where examname is equal to english and email is kap@gmail.com how can i do that i have tried this thing but doesn't work
user.update({email : uemail,"scores.$[i].name": "fullstack" },
{$set : {"scores.$[i].score" : scor}},function(err,result){
console.log(result+"in if");
});
i am trying to update it in app.put() method