Not able to complete 'Chain Search Query Helpers to Narrow Search Results'

:grinning: Hi, I am trying to complete the last lesson of MongoDB and Mongoose and I am not able to pass the tests I have tried checking the hints and other posts on the forum.

Here is my code:

const queryChain = done => {
  const foodToSearch = "burrito";
  Person.find({ favoriteFoods: foodToSearch })
		.sort({ name: 1 })
		.limit(3)
		.select({ name: 1 })
		.exec((err, success) => {
			if (err) return console.error(err)
			done(null, success);
		});
};

And here is the link to my replit.

Please help.

1 Like

limit the results to two documents