How to limit the search results and hide the age of the results?

So, I am doing APIs and Microservices course on FreeCodeCamp, and I am stuck on the last challenge where it says,
"
Find people who like burrito. 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().
"
Link to the challenge: https://www.freecodecamp.org/learn/apis-and-microservices/mongodb-and-mongoose/chain-search-query-helpers-to-narrow-search-results

my code so far:

var queryChain = function(done) {
  var foodToSearch = "burrito";
  Person.find({food:foodToSearch})
        .sort((a,b)=>{
    if(a.name>b.name) return 1
    else if(a.name<b.name) return 0
    else return 0
  })
        .limit(2)
        .select()
        .exec((err,data)=>{
    if(err) console.log(err)
    done(null,data)
  })
};

Can anyone help me on how to limit the search queries and hide the age?

80 thoughts on “How to limit the search results and hide the age of the results?”