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
equals(o: Any!)
Int
java-static SetOptions

Changes the behavior of set() calls to only replace the values specified in its data argument.

java-static SetOptions

Changes the behavior of set() calls to only replace the given fields.

java-static SetOptions
mergeFields(fields: Array<String!>!)

Changes the behavior of set() calls to only replace the given fields.

java-static SetOptions

Changes the behavior of set() calls to only replace the given fields.

Public properties

FieldMask?

Public functions

equals

fun equals(o: Any!): Boolean

hashCode

fun hashCode(): Int

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.

Parameters
fields: (Mutable)List<FieldPath!>

The list of fields to merge.

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.

Parameters
fields: Array<String!>!

The list of fields to merge. Fields can contain dots to reference nested fields within the document.

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.

Parameters
fields: (Mutable)List<String!>

The list of fields to merge. Fields can contain dots to reference nested fields within the document.

Public properties

fieldMask

val fieldMaskFieldMask?