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.
§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.
§
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.
§Parameters
§
reference: DocumentReference<AppModelType, DbModelType>
[src]- A reference to the document to update.