Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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.

§Type Parameters

§
AppModelType
[src]
§
DbModelType extends DocumentData
[src]

§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.

§Return Type

§
Promise<void>
[src]

A Promise resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline).

§
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.

§Type Parameters

§
AppModelType
[src]
§
DbModelType extends DocumentData
[src]

§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.
§
  • An object to configure the set behavior.

§Return Type

§
Promise<void>
[src]

A Promise resolved once the data has been successfully written to the backend (note that it won't resolve while you're offline).