DocumentSnapshot class

A DocumentSnapshot contains data read from a document in your Cloud Firestore database. The data can be extracted with data() or get(<field>) to get a specific field.

See: firebase.google.com/docs/reference/js/firebase.firestore.DocumentSnapshot.

Properties

exists bool
Signals whether or not the data exists. true if the document exists.
no setter
hashCode int
The hash code for this object.
no setterinherited
id String
Provides the document's ID.
no setter
jsObject → DocumentSnapshotJsImpl
JS object.
finalinherited
metadata SnapshotMetadata
Non-null metadata about the DocumentSnapshot, including information about its source and local modifications.
no setter
ref DocumentReference
Non-null DocumentReference for the document included in the DocumentSnapshot.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

data() Map<String, dynamic>
Retrieves all fields in the document as a Map.
get(dynamic fieldPath) → dynamic
Retrieves the field specified by fieldPath parameter at the specified field location or null if no such field exists in the document.
isEqual(DocumentSnapshot other) bool
Returns true if this DocumentSnapshot is equal to the provided one.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getInstance(DocumentSnapshotJsImpl jsObject) DocumentSnapshot
Creates a new DocumentSnapshot from a jsObject.