-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
I have a user table already defined, I just need to access its data using scan.
import * as dynamo from 'dynamodb';
async fetchUser(): Promise<any> {
try {
dynamo.AWS.config.update({ accessKeyId: process.env.ACCESS_KEY_ID, secretAccessKey: process.env.SECRET_KEY, region: process.env.REGION });
const user = dynamo.define('User', {
hashKey: 'email',
tableName: 'user'
});
return await user.scan()
.limit(10)
.exec();
} catch (error) {
throw error;
}
}
I'm not getting any data, am I doing anything wrong here. There is nothing documented for fetching data from existing table.
Kindly assist.......!!
Metadata
Metadata
Assignees
Labels
No labels