For example, in my Mongo Aggregate request I'm getting the array, which consists of two objects:
[
{
"key": "first",
"meta": 123,
},
{
"key": "second",
"meta": 567,
"maybeonmorefield": 789
}
]
Is it possible to convert this array to the following object by using only Mongo aggregation framework:
{
"first": {
"meta": 123,
},
"second": {
"meta": 123,
"maybeonmorefield": 789
}
}
As you see, the keys are actually the key field values from the objects in the first examples.
Thanks for any tips :)