Tell us what’s happening:
This is my code, and it gives me this answer. I think the code is correct, it follows the same pattern as the other functions.
const findOneByFood = function(food, done) {
Person.findOne({favouriteFoods: food}, function(err, data) {
if (err) return console.log(err);
done(null, data);
});
};
###Your project link(s)
solution: https://3000-freecodecam-boilerplate-0mwidtcpqef.ws-eu108.gitpod.io
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
Challenge Information:
MongoDB and Mongoose - Use model.findOne() to Return a Single Matching Document from Your Database
