Cannot read property 'modelName' of undefined

Cannot read property 'modelName' of undefined
0

#1

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

i AM GETTing this error in this challenge . i am not able to clear the test.

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

var createAndSavePerson = function(done) {
  
  var Mr = new Person({name:'Silence',age:25,favoriteFoods:"Bread"});
console.log(Mr.name);
  
  Mr.save(function(err, data) {
  console.log("hello");
});
          
  
  done(null, Mr);
  
  
}

i have ceated and saved but still its showing same please consider this