Checked AWS document but did not find any working example.
Here is my attempt
var params = {
TableName: "User",
IndexName:"a-b-index",
KeyConditionExpression: "Country = :country and #s = :status",
FilterExpression: "Id IN (:e)",
ExpressionAttributeValues: {
":country ": "USA",
":status": 1,
":e": "1"
},
ExpressionAttributeNames: {"#s": "Status"}
};
//get users
dynamodb.query(params, function (err, data) {
if (err)
//error
else {
//success
}
});
Got records but it is fetching record which have id 1
but i want to use array like this
var params = {
TableName: "User",
IndexName:"a-b-index",
KeyConditionExpression: "Country = :country and #s = :status",
FilterExpression: "Id IN (:e)",
ExpressionAttributeValues: {
":country ": "USA",
":status": 1,
":e": ["1","2","3"]
},
ExpressionAttributeNames: {"#s": "Status"}
};
//get users
dynamodb.query(params, function (err, data) {
if (err)
//error
else {
//success
}
});
How can make above code as working.want to get records. syntax is correct and query run without error but i am not getting records
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…