有数据库结构如下:
集合MessageList:
{
_id: "id1",
manage_id: "userid_3",
member_idList: [
"userid_1", "userid_2"
]
}
集合 UserList:
{
_id: "userid_1",
Name: "张三"
}, {
_id: "userid_2",
Name: "李四"
}, {
_id: "userid_3",
Name: "王五"
}, {
_id: "userid_4",
Name: "测试用户"
},
想要实现的是查询后输出:
{
_id: "MessageList的_id"
manage: {
_id: "userid_3",
Name: "王五"
},
member_idList: [{
_id: "userid_1",
Name: "张三"
}, {
_id: "userid_2",
Name: "李四"
}]
}
求教各位大神帮忙啊~~
https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/database/aggregate/Aggregate.lookup.html