I’m working on MongoDB challenges and can’t seem to pass the second challenge. Here is my code so far and it seems correct to me, but doesn’t pass the test. What am not seeing? Any help is much appreciated!
/** 2) Create a ‘Person’ Model */
let personSchema = new Schema({
name: {type: String, required: true},
age: Number,
favoriteFoods: [String]
})
const Person = mongoose.model("Person", personSchema)
let createAndSavePerson = function(done) {
let person = new Person({name: "John", age: 34, favoriteFoods: ["ramen", "broccoli"]});
person.save(function(err, data) {
(err ? done(err) : done(null, data))
});
};