Create a Model - Person Schema yields error on FCC

Create a Model - Person Schema yields error on FCC
0

#1

Following these instructions

https://learn.freecodecamp.org/apis-and-microservices/mongodb-and-mongoose/create-a-model/

And using this boiler plate

https://glitch.com/#!/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


#2

Solved with this missing line

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