我在下面查询
db.firstcollection.aggregate([{
$match: {
organization: "org 1"
}
},
{
$lookup: {
from: "secondcollection",
localField: "id",
foreignField: "id",
as: "secondcollection"
}
},
{
"$unwind": "$secondcollection"
},
{
$project: {
id: "$secondcollection.id",
col1: "ddd",
"emailAddress": "$secondcollection.emailAddress",
"fullName": "$secondcollection.fullName"
}
}
])
使用别名secondcollection,我们可以检索第二个集合的文件,但是如何从第一个集合中检索字段
谢谢