Database
[{"_id":{"$oid":"5c5c39e94c9d4404d4577e94"},"Notifications":[{"Object":{"_id":"5e3967cc9fc5720001d7100f","Type":"Transaction"},"Change":{"Verb":"Create","TimeUtc":{"$date":"2020-02-04T12:47:08.796Z"},"Actors":[]},"Group":{"TotalCount":2,"ActualUnreadCount":50,"UnreadCountSnapshot":23,"ReadTimeUtc":{"$date":"2020-08-26T10:24:32.602Z"},"ViewTimeUtc":{"$date":"2020-08-26T10:24:32.602Z"}}}],"LastNotificationTimeUtc":{"$date":"2019-02-21T10:18:57.456Z"},"LastDeletedNotificationTimeUtc":{"$date":"2020-08-26T10:24:30.374Z"}}]
Query
db.collection.aggregate([{$match:{_id:ObjectId("5c5c39e94c9d4404d4577e94")}},{$set:{Notifications:{$map:{input:"$Notifications",in:{$mergeObjects:["$$this",{$cond:[{$eq:["$$this.Object._id","5e3967cc9fc5720001d7100f"]},{Group:{$mergeObjects:["$$this.Group",{ActualUnreadCount:50,UnreadCountSnapshot:"$$this.Group.ActualUnreadCount"}]}},{}]}]}}}}}])