I'm working on a project and we are using Dynamodb as database and i have a document with this structure :
{
"shop_id": "hh-delightme",
"shoppers": [
{
"email": "[email protected]",
"name": "hatim haffane"
},
{
"email": "[email protected]",
"name": "bxdsf sdf sd f"
}
]
},{
"shop_id": "it-delightme",
"shoppers": [
{
"email": "[email protected]",
"name": "hatim haffane"
},
{
"email": "[email protected]",
"name": "bxdsf sdf sd f"
}
]
}
i have two indexs the shop-id-index and email-index , so what i want to do is to get the shoper with the email "[email protected]" in the shop_id "hh-delightme"
i tried this code but without success
var params = {
TableName:"shopper",
KeyConditionExpression:"shop_id = :shop_id AND email = :email",
ExpressionAttributeValues: {
":shop_id":store,
":email":email
}
};
docClient.query(params, function(err, data) {}
can any one help me to get this done , thanks