最简单的方法是通过一个循环,重复请求数据库,但是会增加数据库的访问次数
能否通过一个请求就完成
例如
doc.collection(‘someCollection’).doc(<idList>)
这种
用where加db.command
var
_ =db.command
db.collection(
'collection'
).where({_id:_.
in
(idList)}).get()
参考文档 https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/database/command.in.html