Can someone help me out here? The tests keep failing (Time-Out error message) and I don’t know why. Been struggling with this one for a while and checked many similar forum posts, most of which seemed to be unresolved.
Task:
Modify the queryChain function to find people who like the food specified by the variable named foodToSearch. Sort them by name, limit the results to two documents, and hide their age. Chain .find(), .sort(), .limit(), .select(), and then .exec(). Pass the done(err, data) callback to exec().
Thank you Sky, but I do not see what the problem is. I’m passing the callback exactly the same as I’ve passed it to all the previous Model. methods, which worked. Some examples:
YourQuery.exec(function(err, docs) {
//do something here
});
I don’t see any anything in the instructions, the hints, nor the manual, that suggest I should do anything different from what I’ve been doing this entire unit.
select should only exclude age and not include anything.
It doesn’t really make sense to return a console.log seeing as it returns undefined. You can log the error before calling done(err). The test should pass anyway but it isn’t the syntax taught.