Note: all these are happening on the local instance of DynamoDB.
This is the code that I\'ve used to create a table from the DynamoDB Shell:
var para
Note: This answer may no longer be valid as mentioned in multiple comments below.
The function that must be used to add records into the database from nodejs is put
and not putItem
which is used in the DynamoDB shell. Changing the above function to the following fixed it.
function(request, response) {
params = {
TableName: 'TABLE-NAME',
Item: {
pid: 'abc123'
}
};
console.log(params);
dynamodb.put(params, function(err, data) {
if (err)
console.log(JSON.stringify(err, null, 2));
else
console.log(JSON.stringify(data, null, 2));
});
}