Skip to content

Instantly share code, notes, and snippets.

@nathanpeck
Created June 6, 2018 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanpeck/2e39000bbfab9354055466f744319cdb to your computer and use it in GitHub Desktop.
Save nathanpeck/2e39000bbfab9354055466f744319cdb to your computer and use it in GitHub Desktop.
messages = await this.dynamoDB.query({
TableName: this.tableName,
KeyConditionExpression: 'room = :room',
Limit: 20,
ExpressionAttributeValues: {
':room': where.room
},
ExclusiveStartKey: where.message ? where : undefined,
ScanIndexForward: false // Always return newest items first
}).promise();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment