var dynamodb = new AWS.DynamoDB({
region: 'us-east-1',
endpoint: "http://localhost:8000"
});
var tableName = "yourTableName";
var params = {
TableName: tableName,
Select: "ALL_ATTRIBUTES"
};
// A callback that paginates through an entire DynamoDB table
function doScan(response) {
if (response.error) ppJson(response.error); // an error occurred
else {
ppJson(response.data); // successful response
// More data. Keep calling scan.
if ('LastEvaluatedKey' in response.data) {
response.request.params.ExclusiveStartKey = response.data.LastEvaluatedKey;
dynamodb.scan(response.request.params)
.on('complete', doScan)
.send();
}
}
}
// Kick off the scan
console.log("Starting a Scan of the table");
dynamodb.scan(params)
.on('complete', doScan)
.send();