I have this simplex array example in stage
equipaments: [
{id: 1, number: 1029393, card: 12333},
{id: 2, number: 1029394, card: 12334},
{id: 3, number: 1029395, card: 12335}
]
I would like to get this output in the project
['1029393-12333', '1029394-12334', '1029395-12335']
I m trying something like this
{$project: {
'equipaments': {
$reduce: {
input: '$eqp',
initialValue: [],
in: {
$concat: ['$$eqp.number', '-', '$$eqp.card']
}
}
}
}}