endAtDocument method

Query<T> endAtDocument(
  1. DocumentSnapshot<Object?> snapshot
)

Creates and returns a new Query that ends at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.

snapshot the snapshot of the document to end at.

Returns the created Query.

Implementation

Query<T> endAtDocument(DocumentSnapshot<Object?> snapshot) {
  checkNotNull<DocumentSnapshot<Object?>>(
    snapshot,
    'Provided snapshot must not be null.',
  );
  final Bound bound = _builder.boundFromDocument(
    query,
    'endAt',
    snapshot.document,
    inclusive: true,
  );
  return _withQuery(query.endAt(bound));
}