📜  dynamodb 分页 nodejs - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:41.937000             🧑  作者: Mango

代码示例1
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;
    }
}