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.

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