【发布时间】:2014-10-05 16:57:58
【问题描述】:
我正在使用 Node.js 的以下代码从 dynamodb 获取项目
var params = {
AttributesToGet: [
"password"
],
TableName : 'foo',
Key : {
"username" : {
"S" : "bar"
},
}
}
db.getItem(params, function(err, data) {
if (err) {
console.log(err); // an error occurred
}
else {
console.log(data); // successful response
res.send(data);
}
return next();
});
但在某些情况下,我不知道获取项目的键值。 我想知道是否可以根据属性值获取项目。类似于以下内容:
var params = {
AttributesToGet: [
"password"
],
TableName : 'foo',
Attribute : {
"userlocation" : {
"S" : "EUROPE"
},
}
}
【问题讨论】:
标签: node.js amazon-web-services amazon-dynamodb