无法在同一调用中获取特定的子文档和 'root' 值

Cant get specific subdoc and a 'root' value in the same call

我可以得到具体的子文档,但我也想有电子邮件

//The object in the Db looks like this:
{
    _id: some_id,
    email: "an email",
    order: [{
        fakturaId: faktura_id,
        name: "Some name"
        ...
     },...]
}

const salg = await mgUser.find(
    { _id: ObjectId('some_id')},
    {
        order: {
            $elemMatch: { fakturaId: faktura_id }
        }
    }
)

我得到:

 {
        fakturaId: faktura_id,
        name: "Some name"
        ...
 }

并希望拥有:

{
email : "an email",
     {
            fakturaId: faktura_id,
            name: "Some name"
            ...
     }
}

或者我收到电子邮件的任何形式

将电子邮件添加到投影:

const salg = await mgUser.find(
    { _id: ObjectId('some_id')},
    {
        email: 1,
        order: {
            $elemMatch: { fakturaId: faktura_id }
        }
    }
)