第一个集合shop_shop:
"currentBusiness": DBRef("shop_shop_business", ObjectId("5cc83985ef921e27e17e1b6e"))
第二个集合shop_shop_business:
"_id": ObjectId("5cc83985ef921e27e17e1b6e")
写法:
db.getCollection("shop_shop").aggregate([
{
$lookup: {
from: "shop_shop_business",
localField: "currentBusiness.$id",
foreignField: "_id",
as: "doc"
}
}
])