MongoDB and Mongoose - Chain Search Query Helpers to Narrow Search Results

Tell us what’s happening:
Why am I failing the test?

Your project link(s)

Here’s my code;

const queryChain = (done) => {
const foodToSearch = “burrito”;
Person.find({favoriteFoods: foodToSearch})
.sort({ name: 1 })
.limit(2)
.select({ age: 0 })
.exec(function(error, data) {
if (err) return console.log(err);
done(null, data);
});
};

solution: boilerplate-mongomongoose-5 - Node.js Repl - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 11; TECNO LC7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Mobile Safari/537.36

Challenge: MongoDB and Mongoose - Chain Search Query Helpers to Narrow Search Results

Link to the challenge:

I’ve found my mistake :slightly_smiling_face:

Was is the missing return statement?

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