Skip to content

Commit 0361520

Browse files
Porting doc changes from the Web API (#178)
1 parent cfcf06c commit 0361520

4 files changed

Lines changed: 14 additions & 11 deletions

File tree

handwritten/firestore/src/reference.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ class DocumentReference {
404404
* specified in its data argument. Fields omitted from this set() call
405405
* remain untouched.
406406
* @param {Array.<string|FieldPath>=} options.mergeFields - If provided,
407-
* set() only replaces the specified field paths. All data at the specified
408-
* field paths is fully replaced, while the remaining fields remain untouched.
407+
* set() only replaces the specified field paths. Any field path that is not
408+
* specified is ignored and remains untouched.
409409
* @returns {Promise.<WriteResult>} A Promise that resolves with the
410410
* write time of this set.
411411
*

handwritten/firestore/src/transaction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ class Transaction {
187187
* specified in its data argument. Fields omitted from this set() call
188188
* remain untouched.
189189
* @param {Array.<string|FieldPath>=} options.mergeFields - If provided,
190-
* set() only replaces the specified field paths. All data at the specified
191-
* field paths is fully replaced, while the remaining fields remain untouched.
190+
* set() only replaces the specified field paths. Any field path that is not
191+
* specified is ignored and remains untouched.
192192
* @returns {Transaction} This Transaction instance. Used for
193193
* chaining method calls.
194194
*

handwritten/firestore/src/write-batch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ class WriteBatch {
263263
* specified in its data argument. Fields omitted from this set() call
264264
* remain untouched.
265265
* @param {Array.<string|FieldPath>=} options.mergeFields - If provided,
266-
* set() only replaces the specified field paths. All data at the specified
267-
* field paths is fully replaced, while the remaining fields remain untouched.
266+
* set() only replaces the specified field paths. Any field path that is not
267+
* specified is ignored and remains untouched.
268268
* @returns {WriteBatch} This WriteBatch instance. Used for chaining
269269
* method calls.
270270
*

handwritten/firestore/types/firestore.d.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,20 +365,23 @@ declare namespace FirebaseFirestore {
365365
* An options object that configures the behavior of `set()` calls in
366366
* `DocumentReference`, `WriteBatch` and `Transaction`. These calls can be
367367
* configured to perform granular merges instead of overwriting the target
368-
* documents in their entirety by providing a `SetOptions` with `merge: true`.
368+
* documents in their entirety.
369369
*/
370370
export interface SetOptions {
371371
/**
372-
* Changes the behavior of a set() call to deeply merge the values specified
372+
* Changes the behavior of a set() call to only replace the values specified
373373
* in its data argument. Fields omitted from the set() call remain
374374
* untouched.
375375
*/
376376
readonly merge?: boolean;
377377

378378
/**
379-
* Changes the behavior of set() calls to only replace the specified
380-
* field paths. All data at the specified field paths is fully replaced,
381-
* while the remaining fields remain untouched.
379+
* Changes the behavior of set() calls to only replace the specified field
380+
* paths. Any field path that is not specified is ignored and remains
381+
* untouched.
382+
*
383+
* It is an error to pass a SetOptions object to a set() call that is
384+
* missing a value for any of the fields specified here.
382385
*/
383386
readonly mergeFields?: (string|FieldPath)[];
384387
}

0 commit comments

Comments
 (0)