node.js - dynamodb get item call using aws sdk -
node.js - dynamodb get item call using aws sdk -
i using next code node.js item dynamodb
var params = { attributestoget: [ "password" ], tablename : 'foo', key : { "username" : { "s" : "bar" }, } } db.getitem(params, function(err, data) { if (err) { console.log(err); // error occurred } else { console.log(data); // successful response res.send(data); } homecoming next(); });
but there cases not know key value fetching items. want know whether can fetch items based on attribute values. next :
var params = { attributestoget: [ "password" ], tablename : 'foo', attribute : { "userlocation" : { "s" : "europe" }, } }
you can create global secondary indexes on additional attributes want query. http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/gsi.html
node.js amazon-web-services amazon-dynamodb
Comments
Post a Comment