-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite.js
More file actions
31 lines (26 loc) · 777 Bytes
/
write.js
File metadata and controls
31 lines (26 loc) · 777 Bytes
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
var AWS = require("aws-sdk");
let awsConfig = {
"region": "us-east-1",
"endpoint": "http://dynamodb.us-east-1.amazonaws.com",
"accessKeyId": "AKIARD6ATKRQDOIDNRP4",
"secretAccessKey": "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"
};
AWS.config.update(awsConfig);
// Create the DynamoDB service object
var ddb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
var params = {
TableName: "StudyBuddy",
Item: {
"email_id": {S: "autoemailsender111@gmail.com"},
"listOfTasks": {L: [{S: "HI"}]}
},
};
// Call DynamoDB to add the item to the table
ddb.putItem(params, function(err, data) {
if (err) {
console.log("Error", err);
} else {
console.log("Success", data);
}
});
// snippet-end:[dynamodb.JavaScript.item.putItem]