I can not pass this,what is the problem and what do I need to write to make it correct?
Code:
var findPersonById = (personId, done) => {
Person.findById(Person.personId, (err, data) => err ? done(err) : done(null, data));
};
Please help.
I can not pass this,what is the problem and what do I need to write to make it correct?
Code:
var findPersonById = (personId, done) => {
Person.findById(Person.personId, (err, data) => err ? done(err) : done(null, data));
};
Please help.
Hi Barayturk
My first reply here in freecodecamp
Person is a Model, it doesn’t have a property personId.
Maybe this could work:
Person.findById(personId, (err, data) => err ? done(err) : done(null, data));
Regards.
Thank you @miguelangeltorresfp!