Class: ExpressionConverter

dynamo.ExpressionConverter

Expression converter helps convert data maps into a format required by DynamoDB.

Constructors

constructor

new ExpressionConverter(data): ExpressionConverter

Parameters

Name Type
data Object

Returns

ExpressionConverter

Properties

data

Readonly data: Object

Index signature

▪ [key: string]: any

Methods

attributeValuesFormat

attributeValuesFormat(): undefined | Record<string, any>

Converts the data into an array of :attribute = value pairs. This is used in dynamo.UpdateItem({ExpressionAttributeValues=...

Returns

undefined | Record<string, any>


keyConditionExpressionFormat

keyConditionExpressionFormat(): undefined | null | string

Creates a attribute1=:attribute1 AND attr2=:attr2 string from the keys in the data. This is used in dynamo.Query({KeyConditionExpression=...

Returns

undefined | null | string


updateExpressionFormat

updateExpressionFormat(prependString?): undefined | null | string

Creates a SET :attribute1=attribute1, :attr2=attr2 string from the keys in the data. This is used in dynamo.UpdateItem({UpdateExpression=...

Parameters

Name Type Default value
prependString string 'SET '

Returns

undefined | null | string