MongoDB and Mongoose - Create and Save a Record of a Model

Tell us what’s happening:
It runs fine when I run it in replit but once I submit it in freecodecamp, it releases an error. It does create and save an instance in the database in mongoDB but I’m not sure what the problem is. My code matches that of the hint as well.



Your project link(s)

solution: boilerplate-mongomongoose (3) - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15

Challenge: MongoDB and Mongoose - Create and Save a Record of a Model

Link to the challenge:

Your parameter for the person.save callback is err not error. The identifier error doesn’t exist so you get a reference error.

1 Like

thank you. It works now. I don’t know why I didn’t notice it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.