Stuck on MongoDB and Mongoose - Perform Classic Updates by Running Find, Edit, then Save

Tell us what’s happening:
Don’t know what to do.

Your code so far

var findEditThenSave = function(personId, done) {
  var foodToAdd = "hamburger";
  Person.findById(personId, function(err, data) {
    if (err) return console.log(err);
    done(null, data);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36.

Challenge: undefined

Link to the challenge:

Hello Bilal.

From what I know, findById does not take a callback function as a second parameter.

Hope this helps.

Model.findById() takes a callback function:

Hey @Bilalm354, A little late but I was also stuck on this for some time. From the little that I understand, you need to update and save the object passed into the callback by findById. My code which passed:

var findEditThenSave = function(personId, done) {
  var foodToAdd = 'hamburger';
  var person = Person.findById(personId, function(err, person){
    if(err) return console.log(err);
    person.favoriteFoods.push(foodToAdd);, data){
      if(err) console.log(err);
      done(null, data)