Chain search query mongoDb Api task


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

Welcome there,

Do you have a question? The more information you provide, the more likely we will be able to help.