Mongodb 使用lookUp
db.getCollection('ShortProduct').aggregate([{ $lookup: { from: "ShortProductPlans", localField: "_id", foreignField: "productId", as: "plan" } }, { $unwind: "$plan" }, { $addFields: { planCode: "$plan.planCode",planName:"$plan.productPlanName" } }, { $match:{"productStatus":1,"_id":{"$in":["xxxxxxxxxxx"]}} },{ $project: { _id: 1, productFullName: 1, planCode: 1, planName: 1 } }]);