我仍然有一个 mongod noSQL ,如下所示:
db.bynder_jobs.aggregate([
{ $match: { campaignID: { $eq: "12087c22-260a-4fb8-834e-d231c4c277a3" } } },
{
$lookup: {
localField: "presetID",
from: "job_presets",
foreignField: "ID",
as: "joincollection"
}
},
{
$lookup: {
localField: "createdByID",
from: "users",
foreignField: "ID",
as: "joincollection2"
}
},
{
$lookup: {
localField: "campaignID",
from: "campaign",
foreignField: "ID",
as: "joincollection3"
}
},
{
$lookup: {
localField: "campaignID",
from: "campaign",
foreignField: "ID",
as: "joincollection3"
}
}
//{"$lookup":{"localField":"jobMetaproperties","from":"campaign","foreignField":"ID","as":"joincollection3"}}
]);
我还有一个集合(AllMetaData),所以我想映射所有bynder_jobs
。 jobMetaproperties(array)键指向AllMetaData id,并获取AllMetaData.lavel接受所有jobMetaproperties键。