【发布时间】:2019-08-18 12:34:07
【问题描述】:
我正在尝试将家庭子文档 _ids 设置为变量。
这是我的架构:
families: [
{
_id: {
type: mongoose.Types.ObjectId
},
name: {
type: String
},
relation: {
type: String
}
}
]
问题是,我可以让父级的 _id 显示在变量内部,但是当我尝试获取家庭 _ids 时,它在控制台日志中显示 undefined。
将家庭子文档 _ids 放入变量的正确查询是什么?
【问题讨论】: