Home > @firebase/firestore > / > limitToLast
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.
Signature:
export declare function limitToLast(limit: number): QueryConstraint;
Parameters
| Parameter | Type | Description |
|---|---|---|
| limit | number | The maximum number of items to return. |
Returns:
The created Query.