猫鼬在创建时将集合名称复数。所以代替schedule
你应该使用schedules
{ "$lookup": {
"from": "schedules",
"localField": "_id.id",
"foreignField": "customer.id",
"as": "user_detail"
}}
const Schedule = require('/schedules')
{ "$lookup": {
"from": Schedule.collection.name,
"localField": "_id.phone",
"foreignField": "customer.phone",
"as": "user_detail"
}}