Full stack development
ImRkofficial opened this issue · 3 comments
ImRkofficial commented
Full stack development
saady789 commented
Lets fix this and add some description
su340 commented
hi, I am in middle of the course. I am stuck at CURD operation using Schemas and Model (findById). Everything is working well when I am trying to get all the Products , but when Im trying to fecth one product the I am getting the output as "null" .
PLease if you solve the issue in the below code.
exports.getProduct = async(req,res) =>{
const id = req.params.id;
console.log(id);
const product = await Product.findById(id).exec();
res.json(product);
}