Tell us what’s happening:
My Code:
const personSchema = new mongoose.Schema({
name: { type: String, required: true },
age: { type: Number },
favoriteFoods: { type: [String] },
});
const Person = mongoose.model("Person", personSchema);
Getting this error:
[Error: Cannot read properties of undefined (reading ‘modelName’)]
First test went without a hitch.
Tried discarding all changes and redoing the first and second challenge, same error.
Tried copying the repo again, same error.
I did fork it before copying, but it won’t let me copy it directly.
Any help is appreciated, thanks
###Your project link(s)
solution: http://localhost:3000
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
Challenge Information:
MongoDB and Mongoose - Create a Model