startAt method

Query<QueryJsImpl> startAt({
  1. DocumentSnapshot? snapshot,
  2. List? fieldValues,
})

Creates a new Query where the results start at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query.

The DocumentSnapshot parameter is the snapshot of the document you want the query to start at. Or the list of fieldValues to start this query at, in order of the query's order by.

Returns non-null created Query.

firestore().collection('cities')
    .orderBy('name')
    .orderBy('state')
    .startAt(fieldValues: ['Springfield', 'Missouri']);

Implementation

Query startAt({DocumentSnapshot? snapshot, List<dynamic>? fieldValues}) =>
    Query.fromJsObject(
      _wrapPaginatingFunctionCall('startAt', snapshot, fieldValues),
    );