云函数联表查询时,如何根据数组中的对象值来对另一个集合进行查询?
发布于 3 年前 作者 sqiao 4318 次浏览 来自 官方Issues

现有两个集合

1.report-related:

2.report-list:

需求:根据表1的followList关注列表,查出关注的全部人的全部报告(表2)数据

即:要根据表1中的followList,查出列表中每个item对应的表2的数据(对应的字段是Reporter_name和unit),并且放在一个数组中,应该如何实现?

1 回复

unwind+lookup。

另,你们的followlist里不含_id是认真的吗?用name来唯一确定用户吗?重名怎么办?

回到顶部