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

Method update

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

Source from the content-addressed store, hash-verified

243 update<T extends DocumentData = DocumentData>(documentRef: DocumentReference<T>, data: Partial<{ [K in keyof T]: T[K] | FieldValue }>): Transaction;
244 update<T extends DocumentData = DocumentData, K extends keyof T = string>(documentRef: DocumentReference<T>, field: K | FieldPath, value: T[K], moreFieldsAndValues: any[]): Transaction;
245 update(documentRef: any, field: any, value?: any, moreFieldsAndValues?: any): Transaction {
246 let transaction;
247
248 if (arguments.length === 2) {
249 transaction = this.native.update(documentRef.native, serializeItems(field));
250 } else {
251 if (field instanceof FieldPath) {
252 transaction = this.native.update(documentRef.native, field.native, value?.native || value || null, moreFieldsAndValues?.map((value) => value?.native || value) ?? []);
253 } else {
254 transaction = this.native.update(documentRef.native, field.native, value?.native || value || null, moreFieldsAndValues?.map((value) => value?.native || value) ?? []);
255 }
256 }
257
258 return Transaction.fromNative(transaction);
259 }
260
261 set<T extends DocumentData = DocumentData>(documentRef: DocumentReference<T>, data: T, options?: SetOptions): Transaction {
262 let transaction;

Callers

nothing calls this directly

Calls 3

serializeItemsFunction · 0.70
updateMethod · 0.65
fromNativeMethod · 0.45

Tested by

no test coverage detected