Model.find() to Search your Database solution not working

Tell us what’s happening:
I have been unable to pass the tests. All I get is an error logged to the console.
Error on fCC: Find all items corresponding to a criteria should succeed

Error logged in Glitch: [object object]

I have copied the code from the solution. This did not work either. It was near-identical to my original code, anyway.

Link to Glitch: https://glitch.com/edit/#!/tartan-sense

Your code so far

var findPeopleByName = function(personName, done) {
  Person.find({name: personName}, function(err, found) {
    if (err) return console.log(err);
    console.log(found);
    done(null, found);
  });
};

Your browser information:

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

Challenge: undefined

Link to the challenge:
https://www.freecodecamp.org/learn/apis-and-microservices/mongodb-and-mongoose/use-model.find-to-search-your-database

Solution found:

Clear database, and resubmit all previous challenges pertaining to MongoDB and Mongoose.

The issue appears to come from incorrect submission of Model in Database.

1 Like