The code examples in this directory demonstrate how to work with Amazon DynamoDB using the AWS SDK for JavaScript version 3 (v3).
Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It's a fully managed, multiregion, multimaster, durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications.
This is a workspace where you can find the following AWS SDK for JavaScript version 3 (v3) Amazon DynamoDB examples:
- Create a DyanamoDB table (CreateTableCommand)
- Create a DyanamoDB table - TV example
- Describe DyanamoDB tables (DescribeTableCommand)
- Delete a DyanamoDB table (DeleteTableCommand)
- Delete an item (DeleteItemCommand)
- Delete items using Document Client (DeleteCommand)
- Get items (GetItemCommand)
- Get batch items (BatchGetItemCommand)
- Get items using Document Client (GetCommand)
- List DyanamoDB tables (ListTablesCommand)
- Put items using Document Client {(PutCommand)
- Query a DyanamoDB table using Document Client (QueryCommand)
- Scan a DyanamoDB table using Document Client (ScanCommand)
- Update a DyanamoDB table using Document Client (UpdateCommand)
- Write batch items using Document Client (BatchGetWriteCommand)
- Write batch items - TV example
- Add an item to a table using PartiQL (ExecuteStatementCommand)
- Add items to a table by batch using PartiQL (BatchExecuteStatementCommand)
- Delete an item from a table using PartiQL (ExecuteStatementCommand)
- Delete items from a table by batch using PartiQL (BatchExecuteStatementCommand)
- Get an item from a table using PartiQL (ExecuteStatementCommand)
- Get items from a table by batch using PartiQL (BatchExecuteStatementCommand)
- Update an item in a table using PartiQL (ExecuteStatementCommand)
- Update items in a table by batch using PartiQL (BatchExecuteStatementCommand)
Note: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see JavaScript ES6/CommonJS syntax.
-
Clone the AWS Code Samples repo to your local environment. See the Github documentation for instructions.
-
Install the dependencies listed in the package.json.
Note: These include the client modules for the AWS services required in these example, which are @aws-sdk/client-dynamodb, @aws-sdk/lib-dynamodb.
npm install node -g
cd javascriptv3/example_code/dynamodb
npm install
-
In your text editor, update user variables specified in the
Inputs
section of the sample file. -
Run sample code:
cd src
node [example name].js // For example, node ddb_batchgetitem.js
For more information see, the README.