Scan DynamoDB table concurrently (up to 1,000,000 segments), recursively read all items from every segment
$ yarn add @shelf/dynamodb-parallel-scan
const {parallelScan} = require('@shelf/dynamodb-parallel-scan');
(async () => {
const items = await parallelScan(
{
TableName: 'files',
FilterExpression: 'attribute_exists(#fileSize)',
ExpressionAttributeNames: {
'#fileSize': 'fileSize'
},
ProjectionExpression: 'fileSize'
},
{concurrency: 1000}
);
console.log(items);
})();
MIT © Shelf