CollectionReference class

A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using the methods inherited from Query).

Inheritance

Properties

firestore Firestore
The Firestore instance associated with this query
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
ID of the referenced collection.
read-only
path String
A string containing the slash-separated path to this CollectionReference (relative to the root of the database).
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

add(Map<String, dynamic> data) Future<DocumentReference>
Returns a DocumentReference with an auto-generated ID, after populating it with provided data. [...]
buildArguments() Map<String, dynamic>
inherited
document([String path]) DocumentReference
Returns a DocumentReference with the provided path. [...]
endAt(List values) Query
Takes a list of values, creates and returns a new Query that ends at the provided fields relative to the order of the query. [...]
inherited
endAtDocument(DocumentSnapshot documentSnapshot) Query
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. [...]
inherited
endBefore(List values) Query
Takes a list of values, creates and returns a new Query that ends before the provided fields relative to the order of the query. [...]
inherited
endBeforeDocument(DocumentSnapshot documentSnapshot) Query
Creates and returns a new Query that ends before the provided document (exclusive). 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. [...]
inherited
getDocuments({Source source = platform.Source.serverAndCache}) Future<QuerySnapshot>
Fetch the documents for this query
inherited
limit(int length) Query
Creates and returns a new Query that's additionally limited to only return up to the specified number of documents.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
orderBy(dynamic field, {bool descending = false}) Query
Creates and returns a new Query that's additionally sorted by the specified field. The field may be a String representing a single field name or a FieldPath. [...]
inherited
parent() DocumentReference
For subcollections, parent returns the containing DocumentReference. [...]
reference() CollectionReference
Obtains a CollectionReference corresponding to this query's location.
inherited
snapshots({bool includeMetadataChanges = false}) Stream<QuerySnapshot>
Notifies of query results at this location
inherited
startAfter(List values) Query
Takes a list of values, creates and returns a new Query that starts after the provided fields relative to the order of the query. [...]
inherited
startAfterDocument(DocumentSnapshot documentSnapshot) Query
Creates and returns a new Query that starts after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query. [...]
inherited
startAt(List values) Query
Takes a list of values, creates and returns a new Query that starts at the provided fields relative to the order of the query. [...]
inherited
startAtDocument(DocumentSnapshot documentSnapshot) Query
Creates and returns a new Query that starts 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 this query. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
where(dynamic field, {dynamic isEqualTo, dynamic isLessThan, dynamic isLessThanOrEqualTo, dynamic isGreaterThan, dynamic isGreaterThanOrEqualTo, dynamic arrayContains, List arrayContainsAny, List whereIn, bool isNull}) Query
Creates and returns a new Query with additional filter on specified field. field refers to a field in a document. [...]
inherited

Operators

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