The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/firestore > / > FirestoreDataConverter > fromFirestore

FirestoreDataConverter.fromFirestore() method

Called by the Firestore SDK to convert Firestore data into an object of type T. You can access your data by calling: snapshot.data(options).

Signature:

fromFirestore(snapshot: QueryDocumentSnapshot<DocumentData>, options?: SnapshotOptions): T;

Parameters

Parameter Type Description
snapshot QueryDocumentSnapshot<DocumentData> A QueryDocumentSnapshot containing your data and metadata.
options SnapshotOptions The SnapshotOptions from the initial call to data().

Returns:

T