Skip to content

Instantly share code, notes, and snippets.

@vladholubiev
Created November 10, 2022 23:01
Show Gist options
  • Save vladholubiev/35bd4f891166a7dca551f38d5c8d35de to your computer and use it in GitHub Desktop.
Save vladholubiev/35bd4f891166a7dca551f38d5c8d35de to your computer and use it in GitHub Desktop.
import {parallelScan} from './src';
(async () => {
console.time('fetch');
const data = await parallelScan(
{
TableName: 'notifications',
FilterExpression: '#updatedAt > :updatedAt and #senderId = :senderId',
ExpressionAttributeNames: {
'#updatedAt': 'updatedAt',
'#senderId': 'senderId',
},
ExpressionAttributeValues: {
':updatedAt': '2022-01-01T00:00:00.000Z',
':senderId': 'foo-1',
},
ProjectionExpression: 'updatedAt',
},
{concurrency: 250}
);
console.timeEnd('fetch');
console.log(data);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment