expressionAttributeNames property

Map<String, String>? expressionAttributeNames
final

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
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.

Implementation

final Map<String, String>? expressionAttributeNames;