CloudQuery class

A collection query with its values resolved.

Firestore answers a query from an index: one per field on its own, merged for any mix of equality filters; a query that also sorts or range-filters on a second field needs a composite index. plan gives such queries to the database with only their == filters and finishes the rest in the app, with the result the database would give.

Constructors

CloudQuery({List<CloudWhereFilter> filters = const [], List<CloudOrderBy> orderBy = const [], int? limit, String? startAfter})
const

Properties

effectiveOrderBy → List<CloudOrderBy>
The order the database returns documents in: orderBy, then any inequality fields it doesn't name (by name), then the document id, the extra keys following the last explicit sort's direction.
no setter
filters → List<CloudWhereFilter>
final
hashCode → int
The hash code for this object.
no setteroverride
limit → int?
The most documents to return, or null for all.
final
orderBy → List<CloudOrderBy>
final
requiredIndex → CloudIndex?
The composite index the database needs for this query, or null when it runsOnServer: its equality and array fields (by name), its sorts in order, then inequality fields it doesn't sort by.
no setter
runsOnServer → bool
Whether the database runs this query as is, without a composite index: only equality-like filters, or filters and sorts that all name one field (sorting by id ascending is free). Combinations Firestore refuses (two array filters, not-in with !=, in or another not-in) count as not runnable, since the app can answer them.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startAfter → String?
The id of the last document of the previous page: results start after it (paging).
final

Methods

copyWith({int? limit, String? startAfter, List<CloudWhereFilter>? filters}) → CloudQuery
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
plan({bool forceClient = false, Set<String> readyIndexes = const {}, List<CloudWhereFilter> keepOnServer = const []}) → CloudQueryPlan
Splits this query between the database and the app. Queries that runsOnServer, or whose requiredIndex is in readyIndexes, go to the database whole. Others (or all, with forceClient, after the database reported a missing index anyway) send it their == filters, or their first filter when none is ==, and leave the rest (and the paging) to CloudQueryPlan.finish. When keepOnServer is given (the filters the database's rules need to see, such as an expiry bound), those are what the database runs instead.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override