【发布时间】:2020-06-03 17:41:47
【问题描述】:
我有 3 个收藏:
const LeaveSchema = new mongoose.Schema({
employee: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
}
})
const UserSchema = new mongoose.Schema({
company: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Company'
}
})
const CompanySchema = new mongoose.Schema({
//
})
如何获取同一“公司”中“用户”的“叶子”列表
【问题讨论】:
-
如果您提供了 json 格式的示例文档和预期的输出,那就太好了。还有你已经尝试了什么?
标签: node.js mongoose aggregation-framework