DocumentSnapshot<T extends dynamic> class
A DocumentSnapshot contains the data read from a document in a Firestore database. The data can be extracted with data or get.
For a document that does not exist exists is false and data is null.
A Firestore Lite snapshot always comes from the backend: it has no metadata.
- Implementers
Properties
- exists → bool
-
Whether the document exists.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
The ID of the document.
no setter
-
reference
→ DocumentReference<
T> -
The reference of the document.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
contains(
Object field) → bool -
Whether the document has
field, also when its value is null.fieldis a String (dots separate nested fields) or a FieldPath. -
data(
) → T? - The data of the document (converted with the converter of the reference or query it was read through, if any), or null if the document does not exist.
-
get(
Object field) → Object? -
The value of
field, or null if there is no such field or document. Never converted. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator [](
Object field) → Object? -
The value of
field, or null if there is no such field or document. Never converted. Same as get.