QueryBuilder class

Builder for constructing and executing queries on a collection

Constructors

QueryBuilder(String collectionName)

Properties

collectionName String
The collection name to query
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

count() Future<int>
Returns the count of matching documents
first() Future<Map<String, dynamic>?>
Returns the first result or null
get() Future<List<Map<String, dynamic>>>
Executes the query and returns the results
limit(int count) QueryBuilder
Limits the number of results
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offset(int count) QueryBuilder
Skips a number of results (for pagination)
orderBy(String field, {bool descending = false}) QueryBuilder
Adds a sort order to the query
toString() String
A string representation of this object.
override
watch() Stream<List<Map<String, dynamic>>>
Watches the query results for changes
where(String field, {dynamic isEqualTo, dynamic isNotEqualTo, dynamic isGreaterThan, dynamic isGreaterThanOrEqualTo, dynamic isLessThan, dynamic isLessThanOrEqualTo, String? startsWith, String? endsWith, String? contains, dynamic arrayContains, List? arrayContainsAny, List? whereIn, List? whereNotIn, bool? isNull}) QueryBuilder
Adds a filter condition to the query

Operators

operator ==(Object other) bool
The equality operator.
inherited