limitToLast method
Creates and returns a new Query that only returns the last matching documents up to the specified number. This
overrides a previous limit.
You must specify at least one orderBy clause for limitToLast queries, otherwise a StateError is thrown when the query is executed. The results are returned in the order of the query (not reversed).
limit the maximum number of items to return.
Returns the created Query.
Implementation
Query<T> limitToLast(int limit) {
return _withQuery(_builder.limitToLast(query, limit));
}