Class: Google::Cloud::Datastore::V1::Mutation
- Inherits:
-
Object
- Object
- Google::Cloud::Datastore::V1::Mutation
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/datastore/v1/datastore.rb
Overview
A mutation to apply to an entity.
Defined Under Namespace
Modules: ConflictResolutionStrategy
Instance Attribute Summary collapse
-
#base_version ⇒ ::Integer
The version of the entity that this mutation is being applied to.
-
#conflict_resolution_strategy ⇒ ::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy
The strategy to use when a conflict is detected.
-
#delete ⇒ ::Google::Cloud::Datastore::V1::Key
The key of the entity to delete.
-
#insert ⇒ ::Google::Cloud::Datastore::V1::Entity
The entity to insert.
-
#property_mask ⇒ ::Google::Cloud::Datastore::V1::PropertyMask
The properties to write in this mutation.
-
#property_transforms ⇒ ::Array<::Google::Cloud::Datastore::V1::PropertyTransform>
Optional.
-
#update ⇒ ::Google::Cloud::Datastore::V1::Entity
The entity to update.
-
#update_time ⇒ ::Google::Protobuf::Timestamp
The update time of the entity that this mutation is being applied to.
-
#upsert ⇒ ::Google::Cloud::Datastore::V1::Entity
The entity to upsert.
Instance Attribute Details
#base_version ⇒ ::Integer
Returns 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.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#conflict_resolution_strategy ⇒ ::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy
Returns The strategy to use when a conflict is detected. Defaults to
SERVER_VALUE
.
If this is set, then conflict_detection_strategy
must also be set.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#delete ⇒ ::Google::Cloud::Datastore::V1::Key
Returns 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.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#insert ⇒ ::Google::Cloud::Datastore::V1::Entity
Returns The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#property_mask ⇒ ::Google::Cloud::Datastore::V1::PropertyMask
Returns 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.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#property_transforms ⇒ ::Array<::Google::Cloud::Datastore::V1::PropertyTransform>
Returns 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.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#update ⇒ ::Google::Cloud::Datastore::V1::Entity
Returns The entity to update. The entity must already exist. Must have a complete key path.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#update_time ⇒ ::Google::Protobuf::Timestamp
Returns 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.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |
#upsert ⇒ ::Google::Cloud::Datastore::V1::Entity
Returns The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'proto_docs/google/datastore/v1/datastore.rb', line 454 class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The possible ways to resolve a conflict detected in a mutation. module ConflictResolutionStrategy # Unspecified. Defaults to `SERVER_VALUE`. STRATEGY_UNSPECIFIED = 0 # The server entity is kept. SERVER_VALUE = 1 # The whole commit request fails. FAIL = 3 end end |