complete-node-bootcamp
complete-node-bootcamp copied to clipboard
Calculate AverageRating static method not working.
I am stuck in lesson 22 of the 11th section of The node bootcamp course. Because of an unhandledpromiserejectionwarnings that has to do with Tour.findbyidandupdate. I'm getting an error that Tour.findbyidandupdate is not a function. Which is needed to update the average quantity and the number of ratings, after being calculated in the static method on the review schema. @jonasschmedtmann
Did you find a solution? I'm having the same issue now.
Hello, please verify your tourModel.js document if there is the line from above, and remove it/comment it:
const Review = require('./reviewModel');