-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread.js
32 lines (25 loc) · 812 Bytes
/
read.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var AWS = require("aws-sdk");
let awsConfig = {
"region": "us-east-2",
"endpoint": "http://dynamodb.us-east-2.amazonaws.com",
"accessKeyId": "AKIAIDHKWRBLMX4QOONQ", "secretAccessKey": "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"
};
AWS.config.update(awsConfig);
let docClient = new AWS.DynamoDB.DocumentClient();
let fetchOneByKey = function () {
var params = {
TableName: "users",
Key: {
"email_id": "[email protected]",
}
};
docClient.get(params, function (err, data) {
if (err) {
console.log("users::fetchOneByKey::error - " + JSON.stringify(err, null, 2));
}
else {
console.log("users::fetchOneByKey::success - " + JSON.stringify(data, null, 2));
}
})
}
fetchOneByKey();