dynamodb pagination nodejs

Solutions on MaxInterview for dynamodb pagination nodejs by the best coders in the world

showing results for - "dynamodb pagination nodejs"
Julia
03 Feb 2020
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