Chain cursor methods onto find() to build pagination and ordered lists:
.sort({ field: 1 })— Ascending (1) or Descending (-1).limit(n)— Return at mostndocuments.skip(n)— Skip the firstndocuments.countDocuments()— Count matching documents
ADVERTISEMENT