setDoc
Writes to the document referred to by this DocumentReference. If the
document does not yet exist, it will be created.
function setDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>): Promise<void>;
function setDoc<AppModelType, DbModelType extends DocumentData>(
reference: DocumentReference<AppModelType, DbModelType>,
data: PartialWithFieldValue<AppModelType>,
options: SetOptions,
): Promise<void>;§
setDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>): Promise<void>
[src]Writes to the document referred to by this DocumentReference. If the
document does not yet exist, it will be created.
§Parameters
§
reference: DocumentReference<AppModelType, DbModelType>
[src]- A reference to the document to write.
§
data: WithFieldValue<AppModelType>
[src]- A map of the fields and values for the document.
§
setDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, data: PartialWithFieldValue<AppModelType>, options: SetOptions): Promise<void>
[src]Writes to the document referred to by the specified DocumentReference. If
the document does not yet exist, it will be created. If you provide merge
or mergeFields, the provided data can be merged into an existing document.
§Parameters
§
reference: DocumentReference<AppModelType, DbModelType>
[src]- A reference to the document to write.
§
data: PartialWithFieldValue<AppModelType>
[src]- A map of the fields and values for the document.
§
options: SetOptions
[src]- An object to configure the set behavior.