get method

Future<QuerySnapshot<T>> get()

Runs the query on the backend and returns the matching documents.

A limitToLast query is sent with its orderings flipped and the result is reversed here, as the JS SDK does.

Implementation

Future<QuerySnapshot<T>> get() async {
  QueryBuilder.validateHasExplicitOrderByForLimitToLast(query);
  final List<Document> documents = await firestore.run(
    (Datastore datastore) => datastore.runQuery(query),
  );
  return QuerySnapshot<T>(
    this,
    query.hasLimitToLast ? documents.reversed.toList() : documents,
  );
}