SetOptions
class SetOptions
An options object that configures the behavior of set()
calls. By providing one of the SetOptions objects returned by merge
, mergeFields
and mergeFieldPaths
, the set()
calls in DocumentReference
, WriteBatch
and Transaction
can be configured to perform granular merges instead of overwriting the target documents in their entirety.
Summary
Public functions |
|
---|---|
Boolean |
|
Int |
hashCode() |
java-static SetOptions |
merge() Changes the behavior of |
java-static SetOptions |
mergeFieldPaths(fields: (Mutable)List<FieldPath!>) Changes the behavior of |
java-static SetOptions |
mergeFields(fields: Array<String!>!) Changes the behavior of |
java-static SetOptions |
mergeFields(fields: (Mutable)List<String!>) Changes the behavior of |
Public functions
merge
java-static fun merge(): SetOptions
Changes the behavior of set()
calls to only replace the values specified in its data argument. Fields omitted from the set()
call will remain untouched. If your input sets any field to an empty map, all nested fields are overwritten.
mergeFieldPaths
java-static fun mergeFieldPaths(fields: (Mutable)List<FieldPath!>): SetOptions
Changes the behavior of set()
calls to only replace the given fields. Any field that is not specified in fields
is ignored and remains untouched.
It is an error to pass a SetOptions
object to a set()
call that is missing a value for any of the fields specified here in its to data argument.
mergeFields
java-static fun mergeFields(fields: Array<String!>!): SetOptions
Changes the behavior of set()
calls to only replace the given fields. Any field that is not specified in fields
is ignored and remains untouched.
It is an error to pass a SetOptions
object to a set()
call that is missing a value for any of the fields specified here.
mergeFields
java-static fun mergeFields(fields: (Mutable)List<String!>): SetOptions
Changes the behavior of set()
calls to only replace the given fields. Any field that is not specified in fields
is ignored and remains untouched. If your input sets any field to an empty map, all nested fields are overwritten.
It is an error to pass a SetOptions
object to a set()
call that is missing a value for any of the fields specified here.