Chain Search Query Helpers

Chain Search Query Helpers
0
#1

Can’t pass this challenge. I keep getting “the data array length is not what expected”.

Here’s my code:

var queryChain = function(done) {
  var foodToSearch = "burrito";
  Person.find({favoriteFood: foodToSearch}).sort({name: 1}).limit(2).select({age: 0}).exec((err, data) => {
    err ? done(err) : done(null, data);
  });
};

Can anyone see what I’m doing wrong? Thanks!

0 Likes

#2

or favoriteFoods ?..

1 Like

#3

That was a silly mistake… Thanks a lot!

0 Likes