我要使用$ c.cid
此js如何工作?
此customer_url作为c,查找客户使用customer_url.cid
{
$lookup: {
from: "customer_url",
localField: "url_id",
foreignField: "url_id",
as: "c"
}
},
{
$unwind: "$c"
},
{
$lookup: {
as: "customer",
from: "customer_dim",
let: {
cid: "$c.cid"
},
pipeline: [
{
$match: {
$expr: {
$eq: ["$_id", "$$cid"]
}
}
}
]
}
}