db.entitlements.aggregate(
[
{
$lookup:{
from:"customers",
localField:"customer",
foreignField:"_id",
as:"customer"
}
},
{
$unwind:"$customer"
}
]).pretty();
- https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/
- https://www.compose.io/articles/deeper-into-3-2-lookup/
- http://www.codeproject.com/Articles/1077839/Working-with-MongoDBs-lookup-Aggregator
- https://www.mongodb.com/blog/post/joins-and-other-aggregation-enhancements-coming-in-mongodb-3-2-part-1-of-3-introduction