(documentRef: DocumentReference<T>, data: T, options?: SetOptions)
| 259 | } |
| 260 | |
| 261 | set<T extends DocumentData = DocumentData>(documentRef: DocumentReference<T>, data: T, options?: SetOptions): Transaction { |
| 262 | let transaction; |
| 263 | if (options) { |
| 264 | if (typeof options?.merge === 'boolean') { |
| 265 | transaction = this.native.set(serializeItems(data), documentRef.native, com.google.firebase.firestore.SetOptions.merge()); |
| 266 | } else if (options.mergeFields) { |
| 267 | if (Array.isArray(options.mergeFields)) { |
| 268 | if (typeof options.mergeFields[0] === 'string') { |
| 269 | transaction = this.native.set(serializeItems(data), documentRef.native, com.google.firebase.firestore.SetOptions.mergeFields(options.mergeFields as any)); |
| 270 | } else { |
| 271 | const list = java.util.Arrays.asList(options.mergeFields.map((field) => field.native)); |
| 272 | transaction = this.native.set(serializeItems(data), documentRef.native, com.google.firebase.firestore.SetOptions.mergeFieldPaths(list)); |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | } else { |
| 277 | transaction = this.native.set(serializeItems(data), documentRef.native); |
| 278 | } |
| 279 | return Transaction.fromNative(transaction); |
| 280 | } |
| 281 | |
| 282 | get android() { |
| 283 | return this.native; |
nothing calls this directly
no test coverage detected