Ich bin neu in Javascript und node.js und fragte mich, ob jemand mir helfen kann, herauszufinden, die Syntax eines neuen Elements auf eine vorhandene Tabelle auf AWS Dynamodb durch ihr node.js SDK. Hier ist, was ich bisher habe. Gibt es ein Beispiel für das, was ich versuche? Wenn mir jemand in die richtige Richtung zeigen könnte, würde es sehr geschätzt werden.Setzen Sie Element auf DynamoDB Tabelle mit AWS SDK für Node.js
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
}
});
[DynamoDB-Marshaler] (https://github.com/CascadeEnergy/dynamoDb-marshaler) den Schmerz der Formatierung helfen erleichtern – tsuz