Skip to content

Instantly share code, notes, and snippets.

@kaihendry
Created May 9, 2017 04:51
Show Gist options
  • Save kaihendry/fd78865c4d9368d334d4a43517245699 to your computer and use it in GitHub Desktop.
Save kaihendry/fd78865c4d9368d334d4a43517245699 to your computer and use it in GitHub Desktop.
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