'Product.findByIdAndUpdate is not a function

This is my the code I'm using

product = await product.findByIdAndUpdate(req.params.id,req.body,{
 New:true, 
 runValidators:true, 
 useFindAndModify:false
}) ;

But then when I try to test run it with postman I'm being told FindByIdAndUpdate is not a function



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source