从collection.find中的数组传递对象的问题

问题描述

我似乎无法弄清楚如何从collection.find('{pid:Patient [0] [i] .pid}')中的arry中传递对象。这是一个串联问题。

router.get('/fullsurveys/:doctor',async (request,res) => {
    try{
        const doctor = JSON.parse(request.params.doctor);
        posts = [];
        patients = [];
        patients.push(await Patient.find(doctor));
        for(var i = 0; i < patients[0].length; i++){
            if(patients[0][i].patientstate == true){
                posts.push(await FullSurvey.find('{pid: patient[0][i].pid}'));
            }
        }
        res.json(posts);   
        }catch(err){
        res.json({message: err});
    }
});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)