# Cloud Firestore V1 API - Class Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform (v2.4.0)

2.4.0 (latest) 2.3.0 2.2.1 2.1.1 2.0.1 1.3.0 1.2.0 1.1.1 1.0.0 0.14.0 0.13.0 0.12.0 0.11.1 0.10.0 0.9.0 0.8.0 0.7.1 0.6.0 0.5.0 0.4.8 Reference documentation and code samples for the Cloud Firestore V1 API class Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform.

A transformation of a field of the document.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #append_missing_elements

    def append_missing_elements() -> ::Google::Cloud::Firestore::V1::ArrayValue

**Returns**

- ([::Google::Cloud::Firestore::V1::ArrayValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ArrayValue)) --- Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array.


  Equivalent numbers of different types (e.g. 3L and 3.0) are
  considered equal when checking if a value is missing.
  NaN is equal to NaN, and Null is equal to Null.
  If the input contains multiple equivalent values, only the first will
  be considered.

  The corresponding transform_result will be the null value.

  Note: The following fields are mutually exclusive: `append_missing_elements`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #append_missing_elements=

    def append_missing_elements=(value) -> ::Google::Cloud::Firestore::V1::ArrayValue

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::ArrayValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ArrayValue)) --- Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array.


  Equivalent numbers of different types (e.g. 3L and 3.0) are
  considered equal when checking if a value is missing.
  NaN is equal to NaN, and Null is equal to Null.
  If the input contains multiple equivalent values, only the first will
  be considered.

  The corresponding transform_result will be the null value.

  Note: The following fields are mutually exclusive: `append_missing_elements`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Firestore::V1::ArrayValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ArrayValue)) --- Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array.


  Equivalent numbers of different types (e.g. 3L and 3.0) are
  considered equal when checking if a value is missing.
  NaN is equal to NaN, and Null is equal to Null.
  If the input contains multiple equivalent values, only the first will
  be considered.

  The corresponding transform_result will be the null value.

  Note: The following fields are mutually exclusive: `append_missing_elements`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #field_path

    def field_path() -> ::String

**Returns**

- (::String) --- The path of the field. See [Document.fields](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document#Google__Cloud__Firestore__V1__Document_fields_instance_ "Google::Cloud::Firestore::V1::Document#fields (method)") for the field path syntax reference.

### #field_path=

    def field_path=(value) -> ::String

**Parameter**

- **value** (::String) --- The path of the field. See [Document.fields](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document#Google__Cloud__Firestore__V1__Document_fields_instance_ "Google::Cloud::Firestore::V1::Document#fields (method)") for the field path syntax reference.
**Returns**

- (::String) --- The path of the field. See [Document.fields](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document#Google__Cloud__Firestore__V1__Document_fields_instance_ "Google::Cloud::Firestore::V1::Document#fields (method)") for the field path syntax reference.

### #increment

    def increment() -> ::Google::Cloud::Firestore::V1::Value

**Returns**

- ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Adds the given value to the field's current value.


  This must be an integer or a double value.
  If the 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.
  If either of the given value or the current field value are doubles,
  both values will be interpreted as doubles. Double arithmetic and
  representation of double values follow IEEE 754 semantics.
  If there is positive/negative integer overflow, the field is resolved
  to the largest magnitude positive/negative integer.

  Note: The following fields are mutually exclusive: `increment`, `set_to_server_value`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #increment=

    def increment=(value) -> ::Google::Cloud::Firestore::V1::Value

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Adds the given value to the field's current value.


  This must be an integer or a double value.
  If the 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.
  If either of the given value or the current field value are doubles,
  both values will be interpreted as doubles. Double arithmetic and
  representation of double values follow IEEE 754 semantics.
  If there is positive/negative integer overflow, the field is resolved
  to the largest magnitude positive/negative integer.

  Note: The following fields are mutually exclusive: `increment`, `set_to_server_value`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Adds the given value to the field's current value.


  This must be an integer or a double value.
  If the 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.
  If either of the given value or the current field value are doubles,
  both values will be interpreted as doubles. Double arithmetic and
  representation of double values follow IEEE 754 semantics.
  If there is positive/negative integer overflow, the field is resolved
  to the largest magnitude positive/negative integer.

  Note: The following fields are mutually exclusive: `increment`, `set_to_server_value`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #maximum

    def maximum() -> ::Google::Cloud::Firestore::V1::Value

**Returns**

- ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Sets the field to the maximum of its current value and the given value.


  This must be an integer or a double value.
  If the 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.
  If a maximum operation is applied where the field and the input value
  are of mixed types (that is - one is an integer and one is a double)
  the field takes on the type of the larger operand. If the operands are
  equivalent (e.g. 3 and 3.0), the field does not change.
  0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
  zero input value is always the stored value.
  The maximum of any numeric value x and NaN is NaN.

  Note: The following fields are mutually exclusive: `maximum`, `set_to_server_value`, `increment`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #maximum=

    def maximum=(value) -> ::Google::Cloud::Firestore::V1::Value

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Sets the field to the maximum of its current value and the given value.


  This must be an integer or a double value.
  If the 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.
  If a maximum operation is applied where the field and the input value
  are of mixed types (that is - one is an integer and one is a double)
  the field takes on the type of the larger operand. If the operands are
  equivalent (e.g. 3 and 3.0), the field does not change.
  0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
  zero input value is always the stored value.
  The maximum of any numeric value x and NaN is NaN.

  Note: The following fields are mutually exclusive: `maximum`, `set_to_server_value`, `increment`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Sets the field to the maximum of its current value and the given value.


  This must be an integer or a double value.
  If the 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.
  If a maximum operation is applied where the field and the input value
  are of mixed types (that is - one is an integer and one is a double)
  the field takes on the type of the larger operand. If the operands are
  equivalent (e.g. 3 and 3.0), the field does not change.
  0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
  zero input value is always the stored value.
  The maximum of any numeric value x and NaN is NaN.

  Note: The following fields are mutually exclusive: `maximum`, `set_to_server_value`, `increment`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #minimum

    def minimum() -> ::Google::Cloud::Firestore::V1::Value

**Returns**

- ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Sets the field to the minimum of its current value and the given value.


  This must be an integer or a double value.
  If the field is not an integer or double, or if the field does not yet
  exist, the transformation will set the field to the input value.
  If a minimum operation is applied where the field and the input value
  are of mixed types (that is - one is an integer and one is a double)
  the field takes on the type of the smaller operand. If the operands are
  equivalent (e.g. 3 and 3.0), the field does not change.
  0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
  zero input value is always the stored value.
  The minimum of any numeric value x and NaN is NaN.

  Note: The following fields are mutually exclusive: `minimum`, `set_to_server_value`, `increment`, `maximum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #minimum=

    def minimum=(value) -> ::Google::Cloud::Firestore::V1::Value

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Sets the field to the minimum of its current value and the given value.


  This must be an integer or a double value.
  If the field is not an integer or double, or if the field does not yet
  exist, the transformation will set the field to the input value.
  If a minimum operation is applied where the field and the input value
  are of mixed types (that is - one is an integer and one is a double)
  the field takes on the type of the smaller operand. If the operands are
  equivalent (e.g. 3 and 3.0), the field does not change.
  0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
  zero input value is always the stored value.
  The minimum of any numeric value x and NaN is NaN.

  Note: The following fields are mutually exclusive: `minimum`, `set_to_server_value`, `increment`, `maximum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Firestore::V1::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Value)) --- Sets the field to the minimum of its current value and the given value.


  This must be an integer or a double value.
  If the field is not an integer or double, or if the field does not yet
  exist, the transformation will set the field to the input value.
  If a minimum operation is applied where the field and the input value
  are of mixed types (that is - one is an integer and one is a double)
  the field takes on the type of the smaller operand. If the operands are
  equivalent (e.g. 3 and 3.0), the field does not change.
  0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
  zero input value is always the stored value.
  The minimum of any numeric value x and NaN is NaN.

  Note: The following fields are mutually exclusive: `minimum`, `set_to_server_value`, `increment`, `maximum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #remove_all_from_array

    def remove_all_from_array() -> ::Google::Cloud::Firestore::V1::ArrayValue

**Returns**

- ([::Google::Cloud::Firestore::V1::ArrayValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ArrayValue)) --- Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array.


  Equivalent numbers of the different types (e.g. 3L and 3.0) are
  considered equal when deciding whether an element should be removed.
  NaN is equal to NaN, and Null is equal to Null.
  This will remove all equivalent values if there are duplicates.

  The corresponding transform_result will be the null value.

  Note: The following fields are mutually exclusive: `remove_all_from_array`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #remove_all_from_array=

    def remove_all_from_array=(value) -> ::Google::Cloud::Firestore::V1::ArrayValue

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::ArrayValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ArrayValue)) --- Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array.


  Equivalent numbers of the different types (e.g. 3L and 3.0) are
  considered equal when deciding whether an element should be removed.
  NaN is equal to NaN, and Null is equal to Null.
  This will remove all equivalent values if there are duplicates.

  The corresponding transform_result will be the null value.

  Note: The following fields are mutually exclusive: `remove_all_from_array`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Firestore::V1::ArrayValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ArrayValue)) --- Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array.


  Equivalent numbers of the different types (e.g. 3L and 3.0) are
  considered equal when deciding whether an element should be removed.
  NaN is equal to NaN, and Null is equal to Null.
  This will remove all equivalent values if there are duplicates.

  The corresponding transform_result will be the null value.

  Note: The following fields are mutually exclusive: `remove_all_from_array`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #set_to_server_value

    def set_to_server_value() -> ::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform::ServerValue

**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform::ServerValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentTransform-FieldTransform-ServerValue)) --- Sets the field to the given server value.


  Note: The following fields are mutually exclusive: `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #set_to_server_value=

    def set_to_server_value=(value) -> ::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform::ServerValue

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform::ServerValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentTransform-FieldTransform-ServerValue)) --- Sets the field to the given server value.


  Note: The following fields are mutually exclusive: `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform::ServerValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentTransform-FieldTransform-ServerValue)) --- Sets the field to the given server value.


  Note: The following fields are mutually exclusive: `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared.