Created
June 14, 2014 07:21
-
-
Save hemc4/f020b8395a2f9a603fa9 to your computer and use it in GitHub Desktop.
Node.js AWS DynamoDb Scan Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'); | |
AWS.config.loadFromPath('./aws.config.json'); | |
var dd = new AWS.DynamoDB(); | |
var tableName = 'session'; | |
var keyName='id'; | |
function getSession() { | |
var db = new AWS.DynamoDB(); | |
db.client.scan({ | |
TableName : tableName, | |
Limit : 1 | |
}, function(err, data) { | |
if (err) { | |
console.log(err); return; | |
} | |
for (var ii in data.Items) { | |
ii = data.Items[ii]; | |
console.log(ii.id); | |
console.log(ii.data); | |
} | |
}); | |
} | |
getSession(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment