Method: Aws::DynamoDB::Types::UpdateItemInput#expression_attribute_names
- Defined in:
- lib/aws-sdk-dynamodb/types.rb
#expression_attribute_names ⇒ Hash<String,String>
One or more substitution tokens for attribute names in an expression. The following are some use cases for using ‘ExpressionAttributeNames`:
-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the **#** character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
‘Percentile`
^
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see [Reserved Words] in the *Amazon DynamoDB Developer Guide*). To work around this, you could specify the following for ‘ExpressionAttributeNames`:
-
‘“#P”:“Percentile”`
^
You could then use this substitution in an expression, as in this example:
-
‘#P = :val`
^
<note markdown=“1”> Tokens that begin with the : character are *expression attribute values*, which are placeholders for the actual value at runtime.
</note>
For more information on expression attribute names, see [Accessing Item Attributes] in the *Amazon DynamoDB Developer Guide*.
[1]: docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html [2]: docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html
7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 |
# File 'lib/aws-sdk-dynamodb/types.rb', line 7929 class UpdateItemInput < Struct.new( :table_name, :key, :attribute_updates, :expected, :conditional_operator, :return_values, :return_consumed_capacity, :return_item_collection_metrics, :update_expression, :condition_expression, :expression_attribute_names, :expression_attribute_values) include Aws::Structure end |