Skip to content

AttributeExpressionMap

Class to manage names and values for DynamoDB attribute expressions

new AttributeExpressionMap(): AttributeExpressionMap;

AttributeExpressionMap

add(name, value): [`#${string}`, `:${string}`];

Adds both an attribute name and value to the map and returns their placeholders

string

The attribute name to add

any

The attribute value to add

[`#${string}`, `:${string}`]

A tuple containing the placeholders for the attribute name and value


addName(name): `#${string}`;

Adds an attribute name to the map and returns its placeholder

string

The attribute name to add

`#${string}`

The placeholder for the attribute name


addValue(value): `:${string}`;

Adds an attribute value to the map and returns its placeholder

any

The attribute value to add

`:${string}`

The placeholder for the attribute value


getNameCount(): number;

Gets the count of unique attribute names in the map

number


getNameFromPlaceholder(placeholder): string | undefined;

Retrieves the attribute name for a given placeholder, or undefined if not found

`#${string}`

string | undefined


getPlaceholderFromName(name): `#${string}` | undefined;

Retrieves the placeholder for a given attribute name, or undefined if not found

string

`#${string}` | undefined


getPlaceholderFromValue(value): `:${string}` | undefined;

Retrieves the placeholder for a given attribute value, or undefined if not found

any

`:${string}` | undefined


getValueCount(): number;

Gets the count of unique attribute values in the map

number


getValueFromPlaceholder(placeholder): any;

Retrieves the attribute value for a given placeholder, or undefined if not found

`:${string}`

any


hasName(name): boolean;

Checks if the map contains a specific attribute name

string

boolean


hasValue(value): boolean;

Checks if the map contains a specific attribute value

any

boolean


toDynamoAttributeExpression(): DynamoAttributeExpression;

Converts both attribute names and values to DynamoDB format

DynamoAttributeExpression


toDynamoAttributeNames(): AttributeNames;

Converts the attribute names to DynamoDB format

AttributeNames


toDynamoAttributeValues(): AttributeValues;

Converts the attribute values to DynamoDB format

AttributeValues