After some processing with a mongo aggregation, I have a collection like :
[{
field1: 10,
field2: 50,
field3: {
name: ["a","b","a","a"],
value: [1,2,3,4]
}
},...]
I am struggling finding a way to convert it into :
[{
field1: 10,
field2: 50,
a:[1,3,4],
b:[2]
},...]
Using mongo aggregation in mongoshell or compass