ExpectedAttributeValue
Represents a condition to be compared with an attribute value. This condition can be used with DeleteItem
, PutItem
, or UpdateItem
operations; if the comparison evaluates to true, the operation succeeds; if not, the operation fails. You can use ExpectedAttributeValue
in one of two different ways:
Use
AttributeValueList
to specify one or more values to compare against an attribute. UseComparisonOperator
to specify how you want to perform the comparison. If the comparison evaluates to true, then the conditional operation succeeds.Use
Value
to specify a value that DynamoDB will compare against an attribute. If the values match, thenExpectedAttributeValue
evaluates to true and the conditional operation succeeds. Optionally, you can also setExists
to false, indicating that you do not expect to find the attribute value in the table. In this case, the conditional operation succeeds only if the comparison evaluates to false.
Value
and Exists
are incompatible with AttributeValueList
and ComparisonOperator
. Note that if you use both sets of parameters at once, DynamoDB will return a ValidationException
exception.
Types
Properties
One or more values to evaluate against the supplied attribute. The number of values in the list depends on the ComparisonOperator
being used.
A comparator for evaluating attributes in the AttributeValueList
. For example, equals, greater than, less than, etc.
Represents the data for the expected attribute.