MCPcopy Index your code
hub / github.com/NativeScript/firebase / update

Method update

packages/firebase-firestore/index.android.ts:1342–1356  ·  view source on GitHub ↗
(documentRef: any, field: any, value?: any, moreFieldsAndValues?: any)

Source from the content-addressed store, hash-verified

1340 update<T extends DocumentData = DocumentData>(documentRef: DocumentReference<T>, data: Partial<{ [K in keyof T]: T[K] | FieldValue }>): WriteBatch;
1341 update<T extends DocumentData = DocumentData, K extends keyof T = string>(documentRef: DocumentReference<T>, field: K | FieldPath, value: FieldValue | T[K], moreFieldAndValues: any[]): WriteBatch;
1342 update<T extends DocumentData = DocumentData>(documentRef: any, field: any, value?: any, moreFieldsAndValues?: any): WriteBatch {
1343 let batch;
1344
1345 if (arguments.length === 2) {
1346 batch = this.native.update(documentRef.native, serializeItems(field));
1347 } else {
1348 if (field instanceof FieldPath) {
1349 batch = this.native.update(documentRef.native, field.native, value?.native || value || null, moreFieldsAndValues?.map((value) => value?.native || value) ?? []);
1350 } else {
1351 batch = this.native.update(documentRef.native, field.native, value?.native || value || null, moreFieldsAndValues?.map((value) => value?.native || value) ?? []);
1352 }
1353 }
1354
1355 return WriteBatch.fromNative(batch);
1356 }
1357}
1358
1359export class Settings implements ISettings {

Callers

nothing calls this directly

Calls 3

serializeItemsFunction · 0.70
updateMethod · 0.65
fromNativeMethod · 0.45

Tested by

no test coverage detected