I have this result after group by UserId with Aggregation Framework. I want create a single Document with "merge" array foo and ability
My Aggregation
{
"result" : [
{
"_id" : {
"userId" : ObjectId("53bab268ceee750615240269")
},
"foo" : [
"0.109",
"0.105",
"0.50",
"0.1",
"foo"
],
"ability" : [
"Power",
"Energy",
"ReactiveEnergy",
"Stamina",
"bar"
]
}
],
"ok" : 1
}
I like to have
{
"result" : [
{
"_id" : {
"userId" : ObjectId("53bab268ceee750615240269")
},
"fooFinal" : [
{"0.109",power}
{"0.105",Energy }
{"0.50",ReactiveEnergy }
{"0.1",Stamina }
{"foo",bar}
],
}
],
"ok" : 1
}
I want to use like similar $each, but i can't use it inside aggregate