我有一个DynamoDB表,一个Item具有以下结构:
{
pickup: "Florida",
tonnage: {
"3ton": {
type: {
nonrefrigerated: [...],
refrigerated: [...]
},
"5ton": {
type: {
nonrefrigerated: [...],
refrigerated: [...]
}
}
}
}
}
我可以通过这样的键来获取商品:
function getData(callback) {
let params = {
TableName: "Locations",
Key: {
pickup: "Florida"
}
};
db.get(params, function(err, data) {
callback(err, data);
});
}
但是如何查询嵌套数据? AWS文档尚不清楚。例如,如何查询:
Select from Locations WHERE pickup='Florida' AND tonnage='5ton' AND Type='nonrefrigerated'