表一:
[
{list: [{city_id: 0001, key1: value1},{city_id: 0002, key2: value2}...]}
]
表二(city表):
[
{_id: 0001, scene: ['天安门','故宫','王府井']},
{_id: 0002, scene: ['东方明珠','外滩']}
.....
]
如上描述:表1里有个list字段是个数组对象, 想要的结果是:通过list数组下面的的每个city_id查询city表,把scene字段添加到表一对应的数组中
结果为:
[
{list: [{city_id: 0001, key1: value1, scene: ['天安门','故宫','王府井']},{city_id: 0002, key2: value2, scene: ['东方明珠','外滩']}...]}
]
嵌套循环查询