complete-node-bootcamp icon indicating copy to clipboard operation
complete-node-bootcamp copied to clipboard

Calculate AverageRating static method not working.

Open MightyEagle96 opened this issue 4 years ago • 2 comments

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 my code

MightyEagle96 avatar May 04 '20 21:05 MightyEagle96

Did you find a solution? I'm having the same issue now.

BorisTheTripper avatar Sep 18 '21 11:09 BorisTheTripper

Hello, please verify your tourModel.js document if there is the line from above, and remove it/comment it: const Review = require('./reviewModel');

crismunt avatar Feb 21 '22 19:02 crismunt