MongoDB and Mongoose - Create Many Records with model.create() what is wrong with my code please help me

var Model = mongoose.model;
var createManyPeople = function(arrayOfPeople, done) {
Model.create(arrayOfPeople, (err, data) => {
if(err) {
done(err);
}
done(null, data);
})
};

Can you format your code next time with preformatted text in the editor next time?

You can’t use Mode.create. You need to call .create on person model which you created in the previous exercise.

Solution:

var createManyPeople = function(arrayOfPeople, done) {
Person.create(arrayOfPeople, (err, data) => {
if(err) {
done(err);
}
done(null, data);
})
};