Class SetOptions
Immutable class representing options for Set operations.
Namespace: Google.Cloud.Firestore
Assembly: Google.Cloud.Firestore.dll
Syntax
public sealed class SetOptions
Properties
FieldMask
The fields to merge. This property is never null; if the mask is empty, all fields will be merged or overwritten.
Declaration
public IReadOnlyList<FieldPath> FieldMask { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<FieldPath> |
Merge
Whether or not to merge values. If FieldMask is non-empty,
this is always true
.
Declaration
public bool Merge { get; }
Property Value
Type | Description |
---|---|
bool |
MergeAll
Returns an instance that merges all fields.
Declaration
public static SetOptions MergeAll { get; }
Property Value
Type | Description |
---|---|
SetOptions |
Overwrite
Returns an instance that overwrites the target object. This is the default when no options are provided.
Declaration
public static SetOptions Overwrite { get; }
Property Value
Type | Description |
---|---|
SetOptions |
Methods
MergeFields(params FieldPath[])
Returns an instance that merges the given fields.
Declaration
public static SetOptions MergeFields(params FieldPath[] fieldMask)
Parameters
Type | Name | Description |
---|---|---|
FieldPath[] | fieldMask | The fields to merge. An empty array is equivalent to using MergeAll. Must not be null or contain any null elements. |
Returns
Type | Description |
---|---|
SetOptions | An instance that merges the given fields. |
MergeFields(params string[])
Returns an instance that merges the given fields.
Declaration
public static SetOptions MergeFields(params string[] fieldMask)
Parameters
Type | Name | Description |
---|---|---|
string[] | fieldMask | 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
Type | Description |
---|---|
SetOptions | An instance that merges the given fields. |