mongoose 怎么多个model查询
不如有个A model: aModel = { user_id: String, file_name: String, page_id: Number } B model: fileSchema = new Schema({ page_id: Number, key: String, doc: String, title: String, sym: String });
bModel = { user_id: String, file_name: String, origin_file: String, new_file: [fileSchema] }
已知user_id,file_name,page_id, model find是异步的,怎么同时查找这两个model,得到两个结果后再进行下一步
3 回复
mongoose不是默认支持promise么?使用promise.all处理两个后拿到数据再处理后边的
promise ==> async / await
function(){ function(){
}
}