Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
Docs Menu

Skip a Number of Documents

If the query bar displays the Skip option, you can specify how many documents to skip before returning the result set.

To specify the number of documents to skip:

1
  1. If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your project from the Projects menu in the navigation bar.

  3. In the sidebar, click Data Explorer under the Database heading.

    The Data Explorer displays.

IMPORTANT: You can also click the name of a cluster to open the Cluster sidebar, and then click Data Explorer under the Shortcuts heading.

2
  1. Select the collection.

  2. In the Query Bar, click Options.

  3. Enter an integer representing the number of documents to skip into the Skip field.

    Results of using the Skip option
    click to enlarge
  4. Click Find to run the query and view the updated results.

    Note

    For query result sets larger than 1000 documents, Atlas shows a subset of the results. Otherwise, Atlas shows the entire result set.

    For details on sampling, see Sampling.

To clear the query bar and the results of the query, click Reset.

$skip corresponds to the LIMIT ... OFFSET ... clause in a SQL SELECT statement.

Example

You have a 3,235 articles. You would like to see a list of articles grouped in blocks of 50, starting with the 436th record.

SQL
SELECT * FROM article
LIMIT 50 OFFSET 435;
MongoDB Aggregation
db.article.aggregate(
{ $limit : 50 },
{ $skip : 435 }
);
Atlas Skip Option
$skip : 435

See the skip entry in the MongoDB Manual.