Class: Google::Cloud::Datastore::V1::PropertyTransform

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/datastore/v1/datastore.rb

Overview

A transformation of an entity property.

Defined Under Namespace

Modules: ServerValue

Instance Attribute Summary collapse

Instance Attribute Details

#append_missing_elements::Google::Cloud::Datastore::V1::ArrayValue

Returns Appends the given elements in order if they are not already present in the current property value. If the property is not an array, or if the property 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 the null value is equal to the null value. If the input contains multiple equivalent values, only the first will be considered.

The corresponding transform result will be the null value.

Returns:

  • (::Google::Cloud::Datastore::V1::ArrayValue)

    Appends the given elements in order if they are not already present in the current property value. If the property is not an array, or if the property 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 the null value is equal to the null value. If the input contains multiple equivalent values, only the first will be considered.

    The corresponding transform result will be the null value.



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'proto_docs/google/datastore/v1/datastore.rb', line 553

class PropertyTransform
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A value that is calculated by the server.
  module ServerValue
    # Unspecified. This value must not be used.
    SERVER_VALUE_UNSPECIFIED = 0

    # The time at which the server processed the request, with millisecond
    # precision. If used on multiple properties (same or different entities)
    # in a transaction, all the properties will get the same server timestamp.
    REQUEST_TIME = 1
  end
end

#increment::Google::Cloud::Datastore::V1::Value

Returns Adds the given value to the property's current value.

This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the given value. If either of the given value or the current property value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follows IEEE 754 semantics. If there is positive/negative integer overflow, the property is resolved to the largest magnitude positive/negative integer.

Returns:

  • (::Google::Cloud::Datastore::V1::Value)

    Adds the given value to the property's current value.

    This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the given value. If either of the given value or the current property value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follows IEEE 754 semantics. If there is positive/negative integer overflow, the property is resolved to the largest magnitude positive/negative integer.



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'proto_docs/google/datastore/v1/datastore.rb', line 553

class PropertyTransform
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A value that is calculated by the server.
  module ServerValue
    # Unspecified. This value must not be used.
    SERVER_VALUE_UNSPECIFIED = 0

    # The time at which the server processed the request, with millisecond
    # precision. If used on multiple properties (same or different entities)
    # in a transaction, all the properties will get the same server timestamp.
    REQUEST_TIME = 1
  end
end

#maximum::Google::Cloud::Datastore::V1::Value

Returns Sets the property to the maximum of its current value and the given value.

This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the given value. If a maximum operation is applied where the property and the input value are of mixed types (that is - one is an integer and one is a double) the property takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the property 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.

Returns:

  • (::Google::Cloud::Datastore::V1::Value)

    Sets the property to the maximum of its current value and the given value.

    This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the given value. If a maximum operation is applied where the property and the input value are of mixed types (that is - one is an integer and one is a double) the property takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the property 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.



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'proto_docs/google/datastore/v1/datastore.rb', line 553

class PropertyTransform
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A value that is calculated by the server.
  module ServerValue
    # Unspecified. This value must not be used.
    SERVER_VALUE_UNSPECIFIED = 0

    # The time at which the server processed the request, with millisecond
    # precision. If used on multiple properties (same or different entities)
    # in a transaction, all the properties will get the same server timestamp.
    REQUEST_TIME = 1
  end
end

#minimum::Google::Cloud::Datastore::V1::Value

Returns Sets the property to the minimum of its current value and the given value.

This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the input value. If a minimum operation is applied where the property and the input value are of mixed types (that is - one is an integer and one is a double) the property takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the property 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.

Returns:

  • (::Google::Cloud::Datastore::V1::Value)

    Sets the property to the minimum of its current value and the given value.

    This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the input value. If a minimum operation is applied where the property and the input value are of mixed types (that is - one is an integer and one is a double) the property takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the property 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.



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'proto_docs/google/datastore/v1/datastore.rb', line 553

class PropertyTransform
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A value that is calculated by the server.
  module ServerValue
    # Unspecified. This value must not be used.
    SERVER_VALUE_UNSPECIFIED = 0

    # The time at which the server processed the request, with millisecond
    # precision. If used on multiple properties (same or different entities)
    # in a transaction, all the properties will get the same server timestamp.
    REQUEST_TIME = 1
  end
end

#property::String

Returns Optional. The name of the property.

Property paths (a list of property names separated by dots (.)) may be used to refer to properties inside entity values. For example foo.bar means the property bar inside the entity property foo.

If a property name contains a dot . or a backlslash \, then that name must be escaped.

Returns:

  • (::String)

    Optional. The name of the property.

    Property paths (a list of property names separated by dots (.)) may be used to refer to properties inside entity values. For example foo.bar means the property bar inside the entity property foo.

    If a property name contains a dot . or a backlslash \, then that name must be escaped.



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'proto_docs/google/datastore/v1/datastore.rb', line 553

class PropertyTransform
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A value that is calculated by the server.
  module ServerValue
    # Unspecified. This value must not be used.
    SERVER_VALUE_UNSPECIFIED = 0

    # The time at which the server processed the request, with millisecond
    # precision. If used on multiple properties (same or different entities)
    # in a transaction, all the properties will get the same server timestamp.
    REQUEST_TIME = 1
  end
end

#remove_all_from_array::Google::Cloud::Datastore::V1::ArrayValue

Returns Removes all of the given elements from the array in the property. If the property is not an array, or if the property does not yet exist, it is set to the empty array.

Equivalent numbers of 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 the null value is equal to the null value. This will remove all equivalent values if there are duplicates.

The corresponding transform result will be the null value.

Returns:

  • (::Google::Cloud::Datastore::V1::ArrayValue)

    Removes all of the given elements from the array in the property. If the property is not an array, or if the property does not yet exist, it is set to the empty array.

    Equivalent numbers of 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 the null value is equal to the null value. This will remove all equivalent values if there are duplicates.

    The corresponding transform result will be the null value.



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'proto_docs/google/datastore/v1/datastore.rb', line 553

class PropertyTransform
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A value that is calculated by the server.
  module ServerValue
    # Unspecified. This value must not be used.
    SERVER_VALUE_UNSPECIFIED = 0

    # The time at which the server processed the request, with millisecond
    # precision. If used on multiple properties (same or different entities)
    # in a transaction, all the properties will get the same server timestamp.
    REQUEST_TIME = 1
  end
end

#set_to_server_value::Google::Cloud::Datastore::V1::PropertyTransform::ServerValue

Returns Sets the property to the given server value.

Returns:



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'proto_docs/google/datastore/v1/datastore.rb', line 553

class PropertyTransform
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A value that is calculated by the server.
  module ServerValue
    # Unspecified. This value must not be used.
    SERVER_VALUE_UNSPECIFIED = 0

    # The time at which the server processed the request, with millisecond
    # precision. If used on multiple properties (same or different entities)
    # in a transaction, all the properties will get the same server timestamp.
    REQUEST_TIME = 1
  end
end