Create a Model - Person Schema yields error on FCC

Following these instructions

And using this boiler plate!/import/github/freeCodeCamp/boilerplate-mongomongoose/

I create the model using this code-

var Schema = mongoose.Schema;

var Person = new Schema({  
  name: {type: String, required: true},
  age: {type: Number},
  favoriteFoods : [String]

When trying to fetch on FCC, I get this error-

Person Model is not correct

1 Like

Solved with this missing line

var Person = mongoose.model("Person", personSchema);