Click here to Skip to main content
15,891,749 members

Comments by Amogs (Top 2 by date)

Amogs 19-Nov-21 4:08am View    
Thank you, What is in line 57 is this code below (from Controllers Instructor code, above) and that's what it is throwing as error:

// 1. Find user from db
let user = await User.findById(req.user._id).select('-password').exec();

And it is the "_id" from findById(req.user._id) that is throwing the error. I can't seem to understand why the error cos I had used it in another scenario to update database and no error was thrown. It successfully found the user by ID and updated it.
So I really can't get why this one is throwing an error.
Amogs 10-Nov-21 18:14pm View    
Thanks man. Funny enough, I had looked at the said 'm' a thousand times today and my mind was showing me a capital 'm'. Not until you confirmed to me it was a small 'm', I changed it and it worked immediately.