Create a model using mongoose stuck forever

Create a model using mongoose stuck forever


I did this

let Person = new mongoose.Schema({
name: {type:String, required: true},
age: Number,
favoriteFoods: [{type: String}]});

However, when I test it, it says person model is not correct. What am I doing wrong?


How are you testing it? When you say the model is not correct what does that mean?

Could you provide an error log?
Maybe a bit more context around your testing.

If we can look at the errors, we can maybe figure out what went wrong :slight_smile:


@psbyron3 My app does not indicate any errors. However, when I paste my app’s link to finish the exercise, it says that the model is not correct. I implemented what has been asked for. What am I missing out?


Are you able to create a Person object on your own?
Did you pass your schema instance to a model?