Firebase.Firestore.SetOptions

An options object that configures the behavior of SetAsync calls.

Summary

By providing one of the SetOptions objects returned by SetOptions.MergeAll and SetOptions.MergeFields(string[]) the SetAsync calls in DocumentReference, WriteBatch and Transaction can be configured to perform granular merges instead of overwriting the target documents in their entirety.

Properties

MergeAll
static SetOptions
Changes the behavior of SetAsync calls to only replace the values specified in its documentData argument.
Overwrite
static SetOptions
Returns an instance that overwrites the target object.

Public static functions

MergeFields(params string[] fields)
Changes the behavior of SetAsync calls to only replace the given fields.
MergeFields(params FieldPath[] fields)
Changes the behavior of SetAsync calls to only replace the given fields.

Public functions

Equals(object obj)
override bool
GetHashCode()
override int
ToString()
override string

Properties

MergeAll

static SetOptions MergeAll

Changes the behavior of SetAsync calls to only replace the values specified in its documentData argument.

Fields omitted from the SetAsync call will remain untouched.

Overwrite

static SetOptions Overwrite

Returns an instance that overwrites the target object.

This is the default when no options are provided.

Public static functions

MergeFields

SetOptions MergeFields(
  params string[] fields
)

Changes the behavior of SetAsync 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.

Details
Parameters
fields
The fields to merge. An empty array is equivalent to using MergeAll. Must not be null or contain any empty or null elements. Each field is treated as a dot-separated list of segments.
Returns
An instance that merges the given fields.

MergeFields

SetOptions MergeFields(
  params FieldPath[] fields
)

Changes the behavior of SetAsync 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 SetAsync call that is missing a value for any of the fields specified here in its data argument.

Details
Parameters
fields
The fields to merge. An empty array is equivalent to using MergeAll. Must not be null or contain any null elements.
Returns
An instance that merges the given fields.

Public functions

Equals

override bool Equals(
  object obj
)

GetHashCode

override int GetHashCode()

ToString

override string ToString()