4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.1

    public static class FieldValue

Reference documentation and code samples for the Firestore API class FieldValue.

A static class providing properties and methods to represent sentinel values.
Sentinel values are special values where the client-side value is not part of the
document modification sent to the server. A property decorated with
[FirestorePropertyAttribute](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FirestorePropertyAttribute) can specify an additional attribute
to indicate that it's a sentinel value, such as a[ServerTimestampAttribute](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.ServerTimestampAttribute),
or the sentinel values returned by the members of this class can be used directly as
values to be serialized (for example, in anonymous types), and they will be handled
directly by the serialization mechanism.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> FieldValue

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Firestore](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore)

## Assembly

Google.Cloud.Firestore.dll

## Properties

### Delete

    public static object Delete { get; }

Sentinel value indicating that the field should be deleted from the document.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` |   |

### ServerTimestamp

    public static object ServerTimestamp { get; }

Sentinel value indicating that the field should be set to the timestamp of the
commit that creates or modifies the document.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` |   |

## Methods

### ArrayRemove(FirestoreDb, params object\[\])

    public static object ArrayRemove(FirestoreDb database, params object[] values)

Creates a sentinel value to indicate the removal of the given values with an array. This over

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FirestoreDb` Database to check for custom serialization. |
| `values` | `https://learn.microsoft.com/dotnet/api/system.object` The values to include in the resulting sentinel value. Must not be null. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` | A sentinel value representing an array removal. |

### ArrayRemove(params object\[\])

    public static object ArrayRemove(params object[] values)

Creates a sentinel value to indicate the removal of the given values with an array.
This overload assumes that any custom serializers are configured via attributes. Use the overload
accepting a [FirestoreDb](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FirestoreDb) if you need to use database-registered custom serializers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://learn.microsoft.com/dotnet/api/system.object` The values to include in the resulting sentinel value. Must not be null. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` | A sentinel value representing an array removal. |

### ArrayUnion(FirestoreDb, params object\[\])

    public static object ArrayUnion(FirestoreDb database, params object[] values)

Creates a sentinel value to indicate the union of the given values with an array.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FirestoreDb` Database to check for custom serialization. |
| `values` | `https://learn.microsoft.com/dotnet/api/system.object` The values to include in the resulting sentinel value. Must not be null. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` | A sentinel value representing an array union. |

### ArrayUnion(params object\[\])

    public static object ArrayUnion(params object[] values)

Creates a sentinel value to indicate the union of the given values with an array.
This overload assumes that any custom serializers are configured via attributes. Use the overload
accepting a [FirestoreDb](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FirestoreDb) if you need to use database-registered custom serializers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://learn.microsoft.com/dotnet/api/system.object` The values to include in the resulting sentinel value. Must not be null. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` | A sentinel value representing an array union. |

### Increment(double)

    public static object Increment(double amount)

Creates a sentinel value to indicate an increment by the given value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `amount` | `https://learn.microsoft.com/dotnet/api/system.double` The amount to increment the field by. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` | A sentinel value representing a field increment. |

**Remarks**
If the current value is an integer or a double, both the current and the given value will be
interpreted as doubles and all arithmetic will follow IEEE 754 semantics.Otherwise, the
transformation will set the field to the given value.

### Increment(long)

    public static object Increment(long amount)

Creates a sentinel value to indicate an increment by the given value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `amount` | `https://learn.microsoft.com/dotnet/api/system.int64` The amount to increment the field by. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.object` | A sentinel value representing a field increment. |

**Remarks**
If the current field value is an integer, possible integer overflows are resolved to
[MaxValue](https://learn.microsoft.com/dotnet/api/system.int64.maxvalue) or [MinValue](https://learn.microsoft.com/dotnet/api/system.int64.minvalue). If the current field value
is a double, both values will be interpreted as doubles and the arithmetic will follow IEEE 754 semantics.


If the current field is not an integer or double, or if the field does not yet exist, the
transformation will set the field to the given value.