(documentRef: DocumentReference, data: DocumentData, options?: SetOptions)
| 1306 | } |
| 1307 | |
| 1308 | set(documentRef: DocumentReference, data: DocumentData, options?: SetOptions): WriteBatch { |
| 1309 | if (options) { |
| 1310 | if (typeof options?.merge === 'boolean') { |
| 1311 | const opts = com.google.firebase.firestore.SetOptions.merge(); |
| 1312 | return WriteBatch.fromNative(this.native.set(documentRef.native, serializeItems(data), opts)); |
| 1313 | } |
| 1314 | |
| 1315 | if (options.mergeFields) { |
| 1316 | if (Array.isArray(options.mergeFields)) { |
| 1317 | if (typeof options.mergeFields[0] === 'string') { |
| 1318 | return WriteBatch.fromNative(this.native.set(documentRef.native, serializeItems(data), com.google.firebase.firestore.SetOptions.mergeFields(options.mergeFields as any))); |
| 1319 | } |
| 1320 | |
| 1321 | const list = java.util.Arrays.asList(options.mergeFields.map((field) => field.native)); |
| 1322 | return WriteBatch.fromNative(this.native.set(documentRef.native, serializeItems(data), com.google.firebase.firestore.SetOptions.mergeFields(list))); |
| 1323 | } |
| 1324 | } |
| 1325 | |
| 1326 | return null; |
| 1327 | } else { |
| 1328 | return WriteBatch.fromNative(this.native.set(documentRef.native, serializeItems(data))); |
| 1329 | } |
| 1330 | } |
| 1331 | |
| 1332 | get native() { |
| 1333 | return this._native; |
nothing calls this directly
no test coverage detected