AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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. Use ComparisonOperator
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, then ExpectedAttributeValue
evaluates to true and the
conditional operation succeeds. Optionally, you can also set Exists
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.
Namespace: Amazon.DynamoDBv2.Model
Assembly: AWSSDK.DynamoDBv2.dll
Version: 3.x.y.z
public class ExpectedAttributeValue
The ExpectedAttributeValue type exposes the following members
Name | Description | |
---|---|---|
ExpectedAttributeValue() |
Empty constructor used to set properties independently even when a simple constructor is available |
|
ExpectedAttributeValue(AttributeValue) |
Instantiates ExpectedAttributeValue with the parameterized properties |
|
ExpectedAttributeValue(bool) |
Instantiates ExpectedAttributeValue with the parameterized properties |
Name | Type | Description | |
---|---|---|---|
AttributeValueList | System.Collections.Generic.List<Amazon.DynamoDBv2.Model.AttributeValue> |
Gets and sets the property AttributeValueList.
One or more values to evaluate against the supplied attribute. The number of values
in the list depends on the For type Number, value comparisons are numeric.
String value comparisons for greater than, equals, or less than are based on ASCII
character code values. For example, For Binary, DynamoDB treats each byte of the binary data as unsigned when it compares binary values. For information on specifying data types in JSON, see JSON Data Format in the Amazon DynamoDB Developer Guide. |
|
ComparisonOperator | Amazon.DynamoDBv2.ComparisonOperator |
Gets and sets the property ComparisonOperator.
A comparator for evaluating attributes in the The following comparison operators are available:
The following are descriptions of each comparison operator.
|
|
Exists | System.Boolean |
Gets and sets the property Exists. Causes DynamoDB to evaluate the value before attempting a conditional operation:
The default setting for
DynamoDB returns a
|
|
Value | Amazon.DynamoDBv2.Model.AttributeValue |
Gets and sets the property Value. Represents the data for the expected attribute. Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself. For more information, see Data Types in the Amazon DynamoDB Developer Guide. |
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5