MongoDB limit() Method

Use the limit() method on a cursor to specify the maximum number of documents the cursor will return. limit() is analogous to the LIMIT statement in a SQL database.

Note- You must apply limit() to the cursor before retrieving any documents from the database.

Use limit() to maximize performance and prevent MongoDB from returning more results than required for processing.

MongoDB skip() method

In MongoDB, skip() technique is utilized to avoid the report. It is utilized with find() and confine() routines.

Syntax

						
db.COLLECTION_NAME.find().limit(NUMBER).skip(NUMBER)