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

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -