4 ms·
There are no explicit foreign key relationships though if that is what you mean ?
by christkv 8y ago
There are no explicit foreign key relationships though if that is what you mean ?
- xellisx 8y agoI know there was a way to "link" records, but do to do anything with them, you had to pull all the data back into your app and manually filter and process records.
- christkv 8y agoThat'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.