1const getAllData = async (params) => {
2
3 console.log("Querying Table");
4 let data = await docClient.query(params).promise();
5
6 if(data['Items'].length > 0) {
7 allData = [...allData, ...data['Items']];
8 }
9
10 if (data.LastEvaluatedKey) {
11 params.ExclusiveStartKey = data.LastEvaluatedKey;
12 return await getAllData(params);
13
14 } else {
15 return data;
16 }
17}
18