In this lesson, I will show how to limit and skip records on MongoDB SELECT queries.
Query with LIMIT:
Syntax:
db.collection.find().limit(number)
Example:
db.employees.find().limit(2)
Limit and skip:
Syntax:
db.collection.find().limit(number).skip(number)
Example:
db.employees.find().limit(2).skip(2)