How to read data from AWS DynamoDB tables using AWS Lambda. get, scan and query methods(Node.js).
AWS , Cloud , Uncategorized / March 30, 2020

This tutorial aims at explaining how to read data from the AWS DynamoDB table. AWS SDK has a class AWS.DynamoDB.DocumentClient, which has methods scan, get and query, that are used to read data from the AWS DynamoDB table.  Documentation on various methods provided by the class is available from the following link AWS.DynamoDB.DocumentClient – Documentation.   Table structure primary partition key – name sort key – age table name – testTable This may not be the ideal table structure but here we use it just as an example.     step 1: Executing the query to get all data from a table – scan method. The scan method is used to  read every item in the table and returns all the data in the table. Filters can be also applied First of all, we create an object scanningPrams which has all the params including the table name, required to scan the DynamoDB table. Simple params to get 10 items from a table “testTable“, would look like this.

The output will have the following structure

The output will have three properties:  Items will have the queried items, ScannedCount will have the number of items evaluated before any scanFilter is…

Share this page in social media platforms