Answers for "dynamodb pagination nodejs"

0

dynamodb pagination nodejs

const getAllData = async (params) => { 

    console.log("Querying Table");
    let data = await docClient.query(params).promise();

    if(data['Items'].length > 0) {
        allData = [...allData, ...data['Items']];
    }

    if (data.LastEvaluatedKey) {
        params.ExclusiveStartKey = data.LastEvaluatedKey;
        return await getAllData(params);

    } else {
        return data;
    }
}
Posted by: Guest on December-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language