需求:用A数据库模型中id查询B数据中是否有,含有相同值的c字段
前台:动态调用接口
rest/ExEquipment/parent/${this.id}
Node.js:A.find().populate({c:id})
async stockList(){
const res2 = await this.$http.get(`rest/ExEquipment/parent/${this.id}`)
this.list = res2.data;
console.log('this.list',res2)
},
router.get('/parent/:id',async (req,res)=>{
console.log('re',req)
const model = await req.Model.find({parent:req.params.id})
res.send(model)
})