How to calculate the total value of two object arrays with the same key but different fields and combine them into one using aggregation in MongoDB?
I have data returned as an array like this: [{ "_id" : ObjectId("65aa4921c767f95a70b8867f"), "creator" : "Henry", "date" : "2023-12-22", "channels" : [ { "key" : "HTV", "value" : 1 } ] }, { "_id" : ObjectId("65aa4921c767f95a70b8867f"), "creator" : "Max", "date"…