I would like to aggregate the following by key and sum the value:
{
"_id": {
"$oid": "60dd5e0bd0ba24343dabc626"
},
"s": {
"_71vnohpi4": {
"q": 2
}
}
},
{
"_id": {
"$oid": "609ea0b0c85ca8e54adc610c"
},
"s": {
"_71vnohpi4": {
"q": 49
},
"_h2121audz": {
"q": 20
}
}
}
Would like to sum the value like:
{
"_id": {
"$oid": "newid-doesntmatter"
},
"s": {
"_71vnohpi4": {
"q": 51
},
"_h2121audz": {
"q": 20
}
}
}
Most of the examples available are for arrays, so $unwind doesn't work in my case. And since the keys are dynamic, I cannot specify the key name.
