DocumentReference<T> class

Annotations
  • @immutable

Properties

firestore Firestore
final
hashCode int
The hash code for this object.
no setteroverride
id String
The last path element of the referenced document.
no setter
parent CollectionReference<T>
A reference to the collection to which this DocumentReference belongs.
no setter
path String
A string representing the path of the referenced document (relative to the root of the database).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collection(String collectionPath) CollectionReference<DocumentData>
Gets a CollectionReference instance that refers to the collection at the specified path.
create(T data) Future<WriteResult>
Create a document with the provided object values. This will fail the write if a document exists at its location.
delete([Precondition? precondition]) Future<WriteResult>
Deletes the document referred to by this DocumentReference.
get() Future<DocumentSnapshot<T>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(T data) Future<WriteResult>
Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created.
toString() String
A string representation of this object.
inherited
update(Map<Object?, Object?> data, [Precondition? precondition]) Future<WriteResult>
Updates fields in the document referred to by this DocumentReference. If the document doesn't yet exist, the update fails and the returned Promise will be rejected.
withConverter<R>({required FromFirestore<R> fromFirestore, required ToFirestore<R> toFirestore}) DocumentReference<R>
Changes the de/serializing mechanism for this DocumentReference.

Operators

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