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 > lite > FirestoreDataConverter > toFirestore

FirestoreDataConverter.toFirestore() method

Called by the Firestore SDK to convert a custom model object of type T into a plain Javascript object (suitable for writing directly to the Firestore database). Used with setDoc(), and .

Signature:

toFirestore(modelObject: T): DocumentData;

Parameters

Parameter Type Description
modelObject T

Returns:

DocumentData