bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
A static class providing properties and methods to represent sentinel values.
Summary
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 can specify an additional attribute to indicate that it's a sentinel value, such as a 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.
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to remove the given elements from any array value that already exists on the server.
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to union the given elements with any array value that already exists on the server.
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to increment the field's current value by the given value.
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to increment the field's current value by the given value.
Sentinel value indicating that the field should be deleted from the document.
ServerTimestamp
staticobjectServerTimestamp
Sentinel value indicating that the field should be set to the timestamp of the commit that creates or modifies the document.
Public static functions
ArrayRemove
objectArrayRemove(paramsobject[]elements)
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to remove the given elements from any array value that already exists on the server.
All instances of each element specified will be removed from the array. If the field being modified is not already an array, it will be overwritten with an empty array.
Details
Parameters
elements
The elements to remove from the array.
Returns
The FieldValue sentinel for use in a call to SetAsync() or UpdateAsync().
ArrayUnion
objectArrayUnion(paramsobject[]elements)
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to union the given elements with any array value that already exists on the server.
Each specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array, it will be overwritten with an array containing exactly the specified elements.
Details
Parameters
elements
The elements to union into the array.
Returns
The FieldValue sentinel for use in a call to SetAsync() or UpdateAsync().
Increment
objectIncrement(longvalue)
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to increment the field's current value by the given value.
If the current field value is an integer, possible integer overflows are resolved to System.Int64.MinValue or System.Int64.MaxValue. 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.
Details
Returns
The FieldValue sentinel for use in a call to SetAsync() or UpdateAsync().
Increment
objectIncrement(doublevalue)
Returns a special value that can be used with SetAsync() or UpdateAsync() that tells the server to increment the field's current value by the given value.
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.
Details
Returns
The FieldValue sentinel for use in a call to SetAsync() or UpdateAsync().
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-06-17 UTC."],[],[],null,["# Firebase.Firestore.FieldValue Class Reference\n\nFirebase.Firestore.FieldValue\n=============================\n\nA static class providing properties and methods to represent sentinel values.\n\nSummary\n-------\n\nSentinel 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](/docs/reference/unity/class/firebase/firestore/firestore-property-attribute#class_firebase_1_1_firestore_1_1_firestore_property_attribute) can specify an additional attribute to indicate that it's a sentinel value, such as a [ServerTimestampAttribute](/docs/reference/unity/class/firebase/firestore/server-timestamp-attribute#class_firebase_1_1_firestore_1_1_server_timestamp_attribute), 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.\n\n| ### Properties ||\n|----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [Delete](#class_firebase_1_1_firestore_1_1_field_value_1a5a052c06b8e7d76853965d0286d64951)` = FieldValueProxy.ServerTimestamp()` | `static object` Sentinel value indicating that the field should be deleted from the document. |\n| [ServerTimestamp](#class_firebase_1_1_firestore_1_1_field_value_1a6a7acc0716c4387af701ed5b250575a2) | `static object` Sentinel value indicating that the field should be set to the timestamp of the commit that creates or modifies the document. |\n\n| ### Public static functions ||\n|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ArrayRemove](#class_firebase_1_1_firestore_1_1_field_value_1a4bd53bf887e9f9e1425ccef0eb35026a)`(params object[] elements)` | `object` Returns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to remove the given elements from any array value that already exists on the server. |\n| [ArrayUnion](#class_firebase_1_1_firestore_1_1_field_value_1ac05084586564ce5d391bc35d9422d479)`(params object[] elements)` | `object` Returns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to union the given elements with any array value that already exists on the server. |\n| [Increment](#class_firebase_1_1_firestore_1_1_field_value_1a9744159debfe114ea4d21ab2b0a81c19)`(long value)` | `object` Returns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to increment the field's current value by the given value. |\n| [Increment](#class_firebase_1_1_firestore_1_1_field_value_1a045b4cb714158b545948e7f4131f76dc)`(double value)` | `object` Returns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to increment the field's current value by the given value. |\n\nProperties\n----------\n\n### Delete\n\n```c#\nstatic object Delete = FieldValueProxy.ServerTimestamp()\n``` \nSentinel value indicating that the field should be deleted from the document. \n\n### ServerTimestamp\n\n```c#\nstatic object ServerTimestamp\n``` \nSentinel value indicating that the field should be set to the timestamp of the commit that creates or modifies the document.\n\nPublic static functions\n-----------------------\n\n### ArrayRemove\n\n```c#\nobject ArrayRemove(\n params object[] elements\n)\n``` \nReturns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to remove the given elements from any array value that already exists on the server.\n\nAll instances of each element specified will be removed from the array. If the field being modified is not already an array, it will be overwritten with an empty array.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------|----------------------------------------| | `elements` | The elements to remove from the array. | |\n| **Returns** | The [FieldValue](/docs/reference/unity/class/firebase/firestore/field-value#class_firebase_1_1_firestore_1_1_field_value) sentinel for use in a call to `SetAsync()` or `UpdateAsync()`. |\n\n### ArrayUnion\n\n```c#\nobject ArrayUnion(\n params object[] elements\n)\n``` \nReturns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to union the given elements with any array value that already exists on the server.\n\nEach specified element that doesn't already exist in the array will be added to the end. If the field being modified is not already an array, it will be overwritten with an array containing exactly the specified elements.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------|---------------------------------------| | `elements` | The elements to union into the array. | |\n| **Returns** | The [FieldValue](/docs/reference/unity/class/firebase/firestore/field-value#class_firebase_1_1_firestore_1_1_field_value) sentinel for use in a call to `SetAsync()` or `UpdateAsync()`. |\n\n### Increment\n\n```c#\nobject Increment(\n long value\n)\n``` \nReturns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to increment the field's current value by the given value.\n\nIf the current field value is an integer, possible integer overflows are resolved to System.Int64.MinValue or System.Int64.MaxValue. If the current field value is a double, both values will be interpreted as doubles and the arithmetic will follow IEEE 754 semantics.\n\nIf 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.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Returns** | The [FieldValue](/docs/reference/unity/class/firebase/firestore/field-value#class_firebase_1_1_firestore_1_1_field_value) sentinel for use in a call to `SetAsync()` or `UpdateAsync()`. |\n\n### Increment\n\n```c#\nobject Increment(\n double value\n)\n``` \nReturns a special value that can be used with `SetAsync()` or `UpdateAsync()` that tells the server to increment the field's current value by the given value.\n\nIf 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.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Returns** | The [FieldValue](/docs/reference/unity/class/firebase/firestore/field-value#class_firebase_1_1_firestore_1_1_field_value) sentinel for use in a call to `SetAsync()` or `UpdateAsync()`. |"]]