在SQL中看起来像:
SELECT *
FROM cats_dat_ref
LEFT OUTER JOIN cats_dat_parts
ON cats_dat_ref.cat_folder = cats_dat_parts.cat_folder
AND cats_dat_ref.ref = cats_dat_parts.ref
我有:
db.cdr.aggregate([
{
$lookup: {
from: "cdp",
localField: "cat_folder",
foreignField: "cat_folder",
as: "cdp"
}
}, {
$project: {
....
}
}
]).forEach(function (item) {
...
});
如何在ref = ref
的查找中添加第二个条件?