Stay organized with collections
Save and categorize content based on your preferences.
Properties
Optional merge
merge: boolean
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-27 UTC.
[null,null,["Last updated 2022-07-27 UTC."],[],[],null,["- [firebase](/docs/reference/js/v8/firebase).\n- [firestore](/docs/reference/js/v8/firebase.firestore).\n- SetOptions \nAn options object that configures the behavior of `set()` calls in\n[DocumentReference](/docs/reference/js/v8/firebase.firestore.DocumentReference#set), [WriteBatch](/docs/reference/js/v8/firebase.firestore.WriteBatch#set) and [Transaction](/docs/reference/js/v8/firebase.firestore.Transaction#set). These calls can be\nconfigured to perform granular merges instead of overwriting the target\ndocuments in their entirety by providing a `SetOptions` with `merge: true`.\n\nIndex\n\nProperties\n\n- [merge](/docs/reference/js/v8/firebase.firestore.SetOptions#merge)\n- [mergeFields](/docs/reference/js/v8/firebase.firestore.SetOptions#mergefields)\n\nProperties\n\nOptional merge \nmerge: boolean \nChanges the behavior of a set() call to only replace the values specified\nin its data argument. Fields omitted from the set() call remain\nuntouched.\n\nOptional mergeFields \nmergeFields: (string \\| [FieldPath](/docs/reference/js/v8/firebase.firestore.FieldPath))\\[\\] \nChanges the behavior of set() calls to only replace the specified field\npaths. Any field path that is not specified is ignored and remains\nuntouched."]]
An options object that configures the behavior of
set()
calls in DocumentReference, WriteBatch and Transaction. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing aSetOptions
withmerge: true
.