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

updateDoc

Updates fields in the document referred to by the specified DocumentReference. The update will fail if applied to a document that does not exist.

function updateDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, data: UpdateData<DbModelType>): Promise<void>;
function updateDoc<AppModelType, DbModelType extends DocumentData>(
reference: DocumentReference<AppModelType, DbModelType>,
field: string | FieldPath,
value: unknown,
...moreFieldsAndValues: unknown[],
): Promise<void>;
§
updateDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, data: UpdateData<DbModelType>): Promise<void>
[src]

Updates fields in the document referred to by the specified DocumentReference. The update will fail if applied to a document that does not exist.

§Type Parameters

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

§Parameters

§
reference: DocumentReference<AppModelType, DbModelType>
[src]
  • A reference to the document to update.
§
data: UpdateData<DbModelType>
[src]
  • An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within 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).

§
updateDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise<void>
[src]

Updates fields in the document referred to by the specified DocumentReference The update will fail if applied to a document that does not exist.

Nested fields can be updated by providing dot-separated field path strings or by providing FieldPath objects.

§Type Parameters

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

§Parameters

§
reference: DocumentReference<AppModelType, DbModelType>
[src]
  • A reference to the document to update.
§
field: string | FieldPath
[src]
  • The first field to update.
§
value: unknown
[src]
  • The first value.
§
...moreFieldsAndValues: unknown[] optional
[src]
  • Additional key value pairs.

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