DocumentReference<T extends Object?> class
Null safety
A DocumentReference refers to a document location in a FirebaseFirestore database and can be used to write, read, or listen to the location.
The document at the referenced location may or may not exist. A DocumentReference can also be used to create a CollectionReference to a subcollection.
Constructors
Properties
- firestore → FirebaseFirestore
-
The Firestore instance associated with this document reference.
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- id → String
-
This document's given ID within the collection.
read-only
-
parent
→ CollectionReference<
T> -
The parent CollectionReference of this document.
read-only
- path → String
-
A string representing the path of the referenced document (relative to the
root of the database).
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
collection(
String collectionPath) → CollectionReference< Map< String, dynamic> > - Gets a CollectionReference instance that refers to the collection at the specified path, relative from this DocumentReference.
-
delete(
) → Future< void> - Deletes the current document from the collection.
-
get(
[GetOptions? options]) → Future< DocumentSnapshot< T> > - Reads the document referenced by this DocumentReference. [...]
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
set(
T data, [SetOptions? options]) → Future< void> - Sets data on the document, overwriting any existing data. If the document does not yet exist, it will be created. [...]
-
snapshots(
{bool includeMetadataChanges = false}) → Stream< DocumentSnapshot< T> > - Notifies of document updates at this location. [...]
-
toString(
) → String -
A string representation of this object. [...]
inherited
-
update(
Map< String, Object?> data) → Future<void> - Updates data on the document. Data will be merged with any existing document data. [...]
-
withConverter<
R> ({required FromFirestore< R> fromFirestore, required ToFirestore<R> toFirestore}) → DocumentReference<R> -
Transforms a DocumentReference to manipulate a custom object instead
of a
Map<String, dynamic>
. [...]
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited