voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
29 lines (16 loc) • 836 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [limitToLast](./firestore_lite.limittolast.md)
## limitToLast() function
Creates a `QueryConstraint` that only returns the last matching documents.
You must specify at least one `orderBy` clause for `limitToLast` queries, otherwise an exception will be thrown during execution.
<b>Signature:</b>
```typescript
export declare function limitToLast(limit: number): QueryConstraint;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| limit | number | The maximum number of items to return. |
<b>Returns:</b>
[QueryConstraint](./firestore_lite.queryconstraint.md)
The created `Query`<!-- -->.