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

Hello everyone,

I hope everyone good.
I need your help.

I haven’t been able to pass this step for months. I really don’t understand what the problem is. I created the secret file and I believe all my information is correct.

The problem is as follows.

Failed:Creating and saving a db item should succeed.

Thanks.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.70

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

Link to the challenge:

My code is;

let Person = model(‘Person’, schema);

const createAndSavePerson = (done) => {
const person = new Person({
name: ‘Semih’,
age: 33,
favoriteFoods: [‘Kebab’],
});

person.save(function(err, data) {
done(null, data);
});
};

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.