<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [/](./firestore_.md) &gt; [limit](./firestore_.limit.md)

## limit() function

Creates a `QueryConstraint` that only returns the first matching documents.

<b>Signature:</b>

```typescript
export declare function limit(limit: number): QueryConstraint;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  limit | number | The maximum number of items to return. |

<b>Returns:</b>

[QueryConstraint](./firestore_.queryconstraint.md)

The created `Query`<!-- -->.

