Home > @firebase/firestore > / > 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 with merge:true
or mergeFields
.
Signature:
toFirestore(modelObject: Partial<T>, options: SetOptions): DocumentData;
Parameters
Parameter | Type | Description |
---|---|---|
modelObject | Partial<T> | |
options | SetOptions |
Returns: