I need help with aggregation.
I have a document like this:
{
group: {
code: 1
},
customerID: 11111
}
and I need to create new document grouped by group code with related customer IDs as array
{
groupCustomerRelation: [
group: {
code: 1
},
customerID: [
11111,
22222,
33333
]
]
}
how can I achieve this?