DynamoDB
Functions
feedTable(tableName: string, items: DynamoDBItemCollection)
feedTable(tableName: string, items: DynamoDBItemCollection)
Inserts items into the given table.
example:
feedTables(items: { [tableName: string]: DynamoDBItemCollection })
feedTables(items: { [tableName: string]: DynamoDBItemCollection })
Feeds several tables with the given data.
The items
parameter is an object of which the keys represent table names, and the values a DynamoDBItemCollection
.
truncateTable(tableName: string, keys?: string[])
truncateTable(tableName: string, keys?: string[])
Deletes all the items from a table. It is useful for cleaning up data between tests.
example:
Types
For TypeScript users, some types are also exported for your convenience.
DynamoDBItem
DynamoDBItem
Represents a single DynamoDB item, represented as a plain JS object.
example:
DynamoDBItemCollection
DynamoDBItemCollection
Represents a collection of DynamoDBItem
. It can be:
An array of
DynamoDBItem
(DynamoDBItem[]
)
example:
A dictionary of
DynamoDBItem
orDynamoDBItem[]
The key has no meaning and no impact on how the data that is actually stored in the table, but it can be useful for readability and/or to access items later easily.
example:
Last updated
Was this helpful?