Created
May 9, 2017 04:51
-
-
Save kaihendry/fd78865c4d9368d334d4a43517245699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scan().then((data) => { | |
console.log("1", data.Count, data.LastEvaluatedKey) | |
if (data.LastEvaluatedKey) { | |
scan(data.LastEvaluatedKey).then((data) => { | |
console.log("2", data.Count, data.LastEvaluatedKey) | |
}) | |
} | |
}) | |
} | |
const scan = (lastEvaluatedKey) => { | |
return dynamodb.scan({ TableName: process.env.TABLE, Limit: 20, ExclusiveStartKey: lastEvaluatedKey }).promise() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment