Firestore in Datastore mode V1 API - Class Google::Cloud::Datastore::V1::Mutation (v1.3.0)

Reference documentation and code samples for the Firestore in Datastore mode V1 API class Google::Cloud::Datastore::V1::Mutation.

A mutation to apply to an entity.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#base_version

def base_version() -> ::Integer
Returns
  • (::Integer) — The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts.

    Note: The following fields are mutually exclusive: base_version, update_time. If a field in that set is populated, all other fields in the set will automatically be cleared.

#base_version=

def base_version=(value) -> ::Integer
Parameter
  • value (::Integer) — The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts.

    Note: The following fields are mutually exclusive: base_version, update_time. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Integer) — The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts.

    Note: The following fields are mutually exclusive: base_version, update_time. If a field in that set is populated, all other fields in the set will automatically be cleared.

#conflict_resolution_strategy

def conflict_resolution_strategy() -> ::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy
Returns

#conflict_resolution_strategy=

def conflict_resolution_strategy=(value) -> ::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy
Parameter
Returns

#delete

def delete() -> ::Google::Cloud::Datastore::V1::Key
Returns
  • (::Google::Cloud::Datastore::V1::Key) — The key of the entity to delete. The entity may or may not already exist. Must have a complete key path and must not be reserved/read-only.

    Note: The following fields are mutually exclusive: delete, insert, update, upsert. If a field in that set is populated, all other fields in the set will automatically be cleared.

#delete=

def delete=(value) -> ::Google::Cloud::Datastore::V1::Key
Parameter
  • value (::Google::Cloud::Datastore::V1::Key) — The key of the entity to delete. The entity may or may not already exist. Must have a complete key path and must not be reserved/read-only.

    Note: The following fields are mutually exclusive: delete, insert, update, upsert. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Datastore::V1::Key) — The key of the entity to delete. The entity may or may not already exist. Must have a complete key path and must not be reserved/read-only.

    Note: The following fields are mutually exclusive: delete, insert, update, upsert. If a field in that set is populated, all other fields in the set will automatically be cleared.

#insert

def insert() -> ::Google::Cloud::Datastore::V1::Entity
Returns
  • (::Google::Cloud::Datastore::V1::Entity) — The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.

    Note: The following fields are mutually exclusive: insert, update, upsert, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

#insert=

def insert=(value) -> ::Google::Cloud::Datastore::V1::Entity
Parameter
  • value (::Google::Cloud::Datastore::V1::Entity) — The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.

    Note: The following fields are mutually exclusive: insert, update, upsert, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Datastore::V1::Entity) — The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.

    Note: The following fields are mutually exclusive: insert, update, upsert, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

#property_mask

def property_mask() -> ::Google::Cloud::Datastore::V1::PropertyMask
Returns
  • (::Google::Cloud::Datastore::V1::PropertyMask) — The properties to write in this mutation. None of the properties in the mask may have a reserved name, except for __key__. This field is ignored for delete.

    If the entity already exists, only properties referenced in the mask are updated, others are left untouched. Properties referenced in the mask but not in the entity are deleted.

#property_mask=

def property_mask=(value) -> ::Google::Cloud::Datastore::V1::PropertyMask
Parameter
  • value (::Google::Cloud::Datastore::V1::PropertyMask) — The properties to write in this mutation. None of the properties in the mask may have a reserved name, except for __key__. This field is ignored for delete.

    If the entity already exists, only properties referenced in the mask are updated, others are left untouched. Properties referenced in the mask but not in the entity are deleted.

Returns
  • (::Google::Cloud::Datastore::V1::PropertyMask) — The properties to write in this mutation. None of the properties in the mask may have a reserved name, except for __key__. This field is ignored for delete.

    If the entity already exists, only properties referenced in the mask are updated, others are left untouched. Properties referenced in the mask but not in the entity are deleted.

#property_transforms

def property_transforms() -> ::Array<::Google::Cloud::Datastore::V1::PropertyTransform>
Returns
  • (::Array<::Google::Cloud::Datastore::V1::PropertyTransform>) — Optional. The transforms to perform on the entity.

    This field can be set only when the operation is insert, update, or upsert. If present, the transforms are be applied to the entity regardless of the property mask, in order, after the operation.

#property_transforms=

def property_transforms=(value) -> ::Array<::Google::Cloud::Datastore::V1::PropertyTransform>
Parameter
  • value (::Array<::Google::Cloud::Datastore::V1::PropertyTransform>) — Optional. The transforms to perform on the entity.

    This field can be set only when the operation is insert, update, or upsert. If present, the transforms are be applied to the entity regardless of the property mask, in order, after the operation.

Returns
  • (::Array<::Google::Cloud::Datastore::V1::PropertyTransform>) — Optional. The transforms to perform on the entity.

    This field can be set only when the operation is insert, update, or upsert. If present, the transforms are be applied to the entity regardless of the property mask, in order, after the operation.

#update

def update() -> ::Google::Cloud::Datastore::V1::Entity
Returns
  • (::Google::Cloud::Datastore::V1::Entity) — The entity to update. The entity must already exist. Must have a complete key path.

    Note: The following fields are mutually exclusive: update, insert, upsert, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

#update=

def update=(value) -> ::Google::Cloud::Datastore::V1::Entity
Parameter
  • value (::Google::Cloud::Datastore::V1::Entity) — The entity to update. The entity must already exist. Must have a complete key path.

    Note: The following fields are mutually exclusive: update, insert, upsert, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Datastore::V1::Entity) — The entity to update. The entity must already exist. Must have a complete key path.

    Note: The following fields are mutually exclusive: update, insert, upsert, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

#update_time

def update_time() -> ::Google::Protobuf::Timestamp
Returns
  • (::Google::Protobuf::Timestamp) — The update time of the entity that this mutation is being applied to. If this does not match the current update time on the server, the mutation conflicts.

    Note: The following fields are mutually exclusive: update_time, base_version. If a field in that set is populated, all other fields in the set will automatically be cleared.

#update_time=

def update_time=(value) -> ::Google::Protobuf::Timestamp
Parameter
  • value (::Google::Protobuf::Timestamp) — The update time of the entity that this mutation is being applied to. If this does not match the current update time on the server, the mutation conflicts.

    Note: The following fields are mutually exclusive: update_time, base_version. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Protobuf::Timestamp) — The update time of the entity that this mutation is being applied to. If this does not match the current update time on the server, the mutation conflicts.

    Note: The following fields are mutually exclusive: update_time, base_version. If a field in that set is populated, all other fields in the set will automatically be cleared.

#upsert

def upsert() -> ::Google::Cloud::Datastore::V1::Entity
Returns
  • (::Google::Cloud::Datastore::V1::Entity) — The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.

    Note: The following fields are mutually exclusive: upsert, insert, update, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

#upsert=

def upsert=(value) -> ::Google::Cloud::Datastore::V1::Entity
Parameter
  • value (::Google::Cloud::Datastore::V1::Entity) — The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.

    Note: The following fields are mutually exclusive: upsert, insert, update, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Datastore::V1::Entity) — The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.

    Note: The following fields are mutually exclusive: upsert, insert, update, delete. If a field in that set is populated, all other fields in the set will automatically be cleared.