3 ms·
That's not been true for awhile. You use the aggregation framework with the $lookup stage to do an outer left join. db.employees.aggregate([{ $lookup: {
by christkv 8y ago
That's not been true for awhile. You use the aggregation framework with the $lookup stage to do an outer left join.
db.employees.aggregate([{
$lookup: {
from: "departments",
localField: "departmentName",
foreignField: "departmentName",
as: "managers"
}
}]);
- christkv 8y agoYou can do nested joins as well. However deeply nested joins in MongoDB is probably an anti-pattern.