exists property
Causes DynamoDB to evaluate the value before attempting a conditional operation:
-
If
Existsistrue, DynamoDB will check to see if that attribute value already exists in the table. If it is found, then the operation succeeds. If it is not found, the operation fails with aConditionCheckFailedException. -
If
Existsisfalse, DynamoDB assumes that the attribute value does not exist in the table. If in fact the value does not exist, then the assumption is valid and the operation succeeds. If the value is found, despite the assumption that it does not exist, the operation fails with aConditionCheckFailedException.
Exists is true. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true,
because it is implied.
DynamoDB returns a ValidationException if:
-
Existsistruebut there is noValueto check. (You expect a value to exist, but don't specify what that value is.) -
Existsisfalsebut you also provide aValue. (You cannot expect an attribute to have a value, while also expecting it not to exist.)
Implementation
final bool? exists;