(documentRef: DocumentReference<T>, data: T, options?: SetOptions)
| 205 | } |
| 206 | |
| 207 | set<T extends DocumentData = DocumentData>(documentRef: DocumentReference<T>, data: T, options?: SetOptions): Transaction { |
| 208 | let transaction; |
| 209 | if (options) { |
| 210 | if (typeof options?.merge === 'boolean') { |
| 211 | transaction = this.native.setDataForDocumentMerge(serializeItems(data), documentRef.native, options.merge); |
| 212 | } else if (options.mergeFields) { |
| 213 | if (Array.isArray(options.mergeFields)) { |
| 214 | if (typeof options.mergeFields[0] === 'string') { |
| 215 | transaction = this.native.setDataForDocumentMergeFields(serializeItems(data), documentRef.native, options.mergeFields); |
| 216 | } else { |
| 217 | transaction = this.native.setDataForDocumentMergeFields( |
| 218 | serializeItems(data), |
| 219 | documentRef.native, |
| 220 | options.mergeFields.map((field) => field.native) |
| 221 | ); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | } else { |
| 226 | transaction = this.native.setDataForDocument(serializeItems(data), documentRef.native); |
| 227 | } |
| 228 | return Transaction.fromNative(transaction); |
| 229 | } |
| 230 | |
| 231 | get ios() { |
| 232 | return this.native; |
nothing calls this directly
no test coverage detected