discontinuedPackage dart_firebase_admin has been discontinued and replaced by firebase_admin_sdk.

endAt method

Query<T> endAt(
  1. List<Object?> fieldValues
)

Creates and returns a new Query that ends at the provided set of field values relative to the order of the query. The order of the provided values must match the order of the order by clauses of the query.

  • fieldValues: The field values to end this query at, in order of the query's order by.
final query = firestore.collection('col');

query.orderBy('foo').endAt(42).get().then((querySnapshot) {
  querySnapshot.forEach((documentSnapshot) {
    print('Found document at ${documentSnapshot.ref.path}');
  });
});

Implementation

Query<T> endAt(List<Object?> fieldValues) {
  final (endAt, fieldOrders) = _cursorFromValues(
    fieldValues: fieldValues,
    before: false,
  );

  final options = _queryOptions.copyWith(
    fieldOrders: fieldOrders,
    endAt: endAt,
  );
  return Query<T>._(
    firestore: firestore,
    queryOptions: options,
  );
}