amazon web services - DynamoDB, AWS, Node.js, newb -
i exploring dynamodb use in node.js project. package.json
{ "name": "generic-server", "version": "0.0.1", "private": true, "engines": { "node": "0.11.x" }, "dependencies": { "express": "3.3.4", "jade": "1.1.5", "aws-sdk": ">= 2.0.9" }
}
now logged aws account , created dynamodb table. , have in index.js
var aws= require('aws-sdk'); aws.config.update({//1 accesskeyid: 'blabla', secretaccesskey: 'blabla', region: 'us-east-1' }); var db = new aws.dynamodb({apiversion: '2014-12-04'}); db.listtables(function(err, data) { // 2 console.log(data); });
so console.log of data null. can think of 2 areas might issue ( numbered them inline 1 or 2 ). appreciated.
i .net, java, , obj c developer playing node.js , aws, fyi.
the first parameter listtables
"params" field , second 1 callback. you're passing callback "params". try this:
db.listtables({}, function (err, data) {//2
http://docs.aws.amazon.com/awsjavascriptsdk/latest/aws/dynamodb.html#listtables-property
Comments
Post a Comment