AttributeExpressionMap
Class to manage names and values for DynamoDB attribute expressions
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AttributeExpressionMap(): AttributeExpressionMap;Returns
Section titled “Returns”AttributeExpressionMap
Methods
Section titled “Methods”add(name, value): [`#${string}`, `:${string}`];Adds both an attribute name and value to the map and returns their placeholders
Parameters
Section titled “Parameters”string
The attribute name to add
any
The attribute value to add
Returns
Section titled “Returns”[`#${string}`, `:${string}`]
A tuple containing the placeholders for the attribute name and value
addName()
Section titled “addName()”addName(name): `#${string}`;Adds an attribute name to the map and returns its placeholder
Parameters
Section titled “Parameters”string
The attribute name to add
Returns
Section titled “Returns”`#${string}`
The placeholder for the attribute name
addValue()
Section titled “addValue()”addValue(value): `:${string}`;Adds an attribute value to the map and returns its placeholder
Parameters
Section titled “Parameters”any
The attribute value to add
Returns
Section titled “Returns”`:${string}`
The placeholder for the attribute value
getNameCount()
Section titled “getNameCount()”getNameCount(): number;Gets the count of unique attribute names in the map
Returns
Section titled “Returns”number
getNameFromPlaceholder()
Section titled “getNameFromPlaceholder()”getNameFromPlaceholder(placeholder): string | undefined;Retrieves the attribute name for a given placeholder, or undefined if not found
Parameters
Section titled “Parameters”placeholder
Section titled “placeholder”`#${string}`
Returns
Section titled “Returns”string | undefined
getPlaceholderFromName()
Section titled “getPlaceholderFromName()”getPlaceholderFromName(name): `#${string}` | undefined;Retrieves the placeholder for a given attribute name, or undefined if not found
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`#${string}` | undefined
getPlaceholderFromValue()
Section titled “getPlaceholderFromValue()”getPlaceholderFromValue(value): `:${string}` | undefined;Retrieves the placeholder for a given attribute value, or undefined if not found
Parameters
Section titled “Parameters”any
Returns
Section titled “Returns”`:${string}` | undefined
getValueCount()
Section titled “getValueCount()”getValueCount(): number;Gets the count of unique attribute values in the map
Returns
Section titled “Returns”number
getValueFromPlaceholder()
Section titled “getValueFromPlaceholder()”getValueFromPlaceholder(placeholder): any;Retrieves the attribute value for a given placeholder, or undefined if not found
Parameters
Section titled “Parameters”placeholder
Section titled “placeholder”`:${string}`
Returns
Section titled “Returns”any
hasName()
Section titled “hasName()”hasName(name): boolean;Checks if the map contains a specific attribute name
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
hasValue()
Section titled “hasValue()”hasValue(value): boolean;Checks if the map contains a specific attribute value
Parameters
Section titled “Parameters”any
Returns
Section titled “Returns”boolean
toDynamoAttributeExpression()
Section titled “toDynamoAttributeExpression()”toDynamoAttributeExpression(): DynamoAttributeExpression;Converts both attribute names and values to DynamoDB format
Returns
Section titled “Returns”toDynamoAttributeNames()
Section titled “toDynamoAttributeNames()”toDynamoAttributeNames(): AttributeNames;Converts the attribute names to DynamoDB format
Returns
Section titled “Returns”toDynamoAttributeValues()
Section titled “toDynamoAttributeValues()”toDynamoAttributeValues(): AttributeValues;Converts the attribute values to DynamoDB format