You’d like a set of documents to be returned in last name, ascending order. Which query will accomplish this?

  •  db.persons.find().sort({lastName: -1}}
  •  db.persons.find().sort({lastName: 1}}
  •  db.persons.find().sort({lastName: ascending}}
  •  db.persons.find().sort({lastName: $asc}}

Leave a Reply

Your email address will not be published. Required fields are marked *