I have the following document:
{
"options": [
{
"cost": 5,
"value": {
"en": "Socket, where I can plug in my own cable",
"fr": "Prise, où je peux brancher mon propre câble"
}
},
{
"cost" 15,
"value": {
"en": "Fixed cable",
"fr": "Câble fixe"
}
}
]
}
And I want to get as value the value of en, something like this:
{
"options": [
{
"cost": 5,
"value": "Socket, where I can plug in my own cable"
},
{
"cost" 15,
"value": "Fixed cable"
}
]
}
I've already tried with $addFields and as field to access with $options.value.en or with nesting. I've tried also with $map but no result.
I don't want to $unwind options and group them after $addFields;