Question:
Supposedly I want to update the object values of array of a document, but first I will need to look for its id first, heres the structure of documentAnswer:
You can use$map
to iterate through notifications
and use $cond
and $mergeObjects
to perform the conditional update.If you have better answer, please add a comment about this, thank you!