我是MongoDB的新手,我正在try 从数据库中获取一个文档并填充一些字段,这是一个示例:
var profile = await this.profileModel
.findById(id)
.populate({
path: 'posts',
populate: {
path: 'comments',
populate: [
{ path: 'author', select: ['_id', 'firstName', 'lastName', 'email', 'image', 'status'] },
],
},
})
.lean();
这里的问题是comments
和author
的_id
是OBJECTID,我想要获取它们的值
我怎样才能做到这一点呢?