app.get("/students/:id",async(req,res)=>{
try {
const _id=req.params.id;
const studentData=await Student.findById(_id);
console.log(studentData);
if(!studentData){
return res.status(404).send();
}else
res.send(studentData);
}
catch(err) {
res.send(err);
}
});
对于这个 id 案例,我能够在数据库中找到值。但是,如果我按照屏幕截图使用 model.find({name:name}),我在邮递员中遇到了一些错误。谁能帮我解决这个问题。