Hi JOSIEY_Vengappallil,
I am new to this community. I am not sure how to update the object in array through index.
Please check the below approach, it might help.
db.getCollection(collectionName).update({"username" : "JAMES BOND", "taskList.title" :"meeting"},
{$set : {"taskList.$.status" : "completed"}})
This will update only matched document in an array.
Thanks,
Naveen
1 Like