> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Limit the Number of Returned Documents

MongoDB Compass Readonly Edition will be deprecated in a future release. To replicate the read-only behavior in a standard Compass edition, assign users [`read`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-read) access at the database level and enable the [readOnly](https://www.mongodb.com/docs/compass/settings/read-only.md#std-label-compass-read-only) option in Compass.

If the query bar has the Limit option, you can specify the maximum number of documents to return.

## Set Documents to Return

To specify the limit:

1. In the Query Bar, click Options.

2. Enter an integer representing the number of documents to return into the Limit field.

3. Click Find to run the query and view the updated results.

   ![Results of specifying query limit](/images/querybar/query-limit-success.png)

## Clear the Query

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

## How Does the Compass Query Compare to MongoDB and SQL Queries?

[`$skip`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/skip.md#mongodb-pipeline-pipe.-skip) corresponds to the `LIMIT ...` clause in a SQL (Structured Query Language) `SELECT` statement.

**Example:**

You have 3,235 articles. You would like to see a list of the first 10 articles.

SQL

```sql
SELECT * FROM article
LIMIT 10;
```

MongoDB Aggregation

```javascript
db.article.aggregate(
  { $limit : 10 }
);
```

Compass Limit Option

```javascript
$limit : 10
```

## Learn More

See the `limit` entry in the [MongoDB Manual.](https://www.mongodb.com/docs/manual/reference/method/cursor.limit/)
