MongoDB Tutorial - MongoDB Limit/Skip Records

Limit() Method

To limit the records in MongoDB, use limit() method. limit() method accepts one number type argument, which is number of documents to return.

The syntax of limit() method is as follows


The following example displays 2 documents.


By default limit() method will display all documents from the collection without parameter.

Skip() Method

skip() accepts number type argument and skips number of documents.

The syntax of skip() method is as follows


The following query displays only second found document.

{"title":"NoSQL Overview"}