【发布时间】:2017-09-15 03:43:03
【问题描述】:
我正在做一个项目,我们使用 Dynamodb 作为数据库,我有一个具有这种结构的文档:
{
"shop_id": "hh-delightme",
"shoppers": [
{
"email": "hatim.haffane@gmail.com",
"name": "hatim haffane"
},
{
"email": "xxx.zzz@gmail.com",
"name": "bxdsf sdf sd f"
}
]
},{
"shop_id": "it-delightme",
"shoppers": [
{
"email": "hatim.haffane@gmail.com",
"name": "hatim haffane"
},
{
"email": "xxx.zzz@gmail.com",
"name": "bxdsf sdf sd f"
}
]
}
我有两个索引 shop-id-index 和 email-index ,所以我想做的是让购物者在 shop_id “hh-delightme”中使用电子邮件“hatim.haffane@gmail.com”
我试过这段代码,但没有成功
var params = {
TableName:"shopper",
KeyConditionExpression:"shop_id = :shop_id AND email = :email",
ExpressionAttributeValues: {
":shop_id":store,
":email":email
}
};
docClient.query(params, function(err, data) {}
谁能帮我完成这个,谢谢
【问题讨论】:
标签: javascript node.js amazon-web-services amazon-dynamodb hapijs