(documentRef: any, field: any, value?: any, moreFieldsAndValues?: any)
| 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; |
nothing calls this directly
no test coverage detected