我是 javascript 和 node.js 的新手,想知道是否有人可以帮助我弄清楚通过他们的 node.js SDK 将新项目放到 AWS Dynamodb 上的现有表中的语法。这是我到目前为止所拥有的。有什么我正在尝试做的例子吗?如果有人能指出我正确的方向,将不胜感激。
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./config.json');
AWS.config.update({region: 'us-east-1'});
var dynamodb = new AWS.DynamoDB();
var item = {
// I need to put the an item with a the primary key of "id", and an attribute called "item"
// I'm new to js and node.js, so if somebody could help me understand the documentation
// http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/frames.html#!http%3A//docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB_20120810.html
}
dynamodb.putItem({TableName: 'log_dev', Item: item}, function(err, data){
if (err) {
console.log(err); // an error occurred
} else {
console.log(data); // successful response
}
});