I try to query my dynamoDB from a Lambda function. My table uses "id" as the hash key. I tried both versions below and received the corresponding error messages. What am I doing wrong?
var params = {
TableName : "addresses",
KeyConditionExpression: "id = :id AND city = :city",
ExpressionAttributeValues: {
":id": "Austria",
":city": "Salzburg"
}
};
Unable to query. Error: { "message": "Query key condition not supported",...}
var params = {
TableName : "addresses",
KeyConditionExpression: "city = :city",
ExpressionAttributeValues: {
":city": "Salzburg"
}
};
Unable to query. Error: { "message": "Query condition missed key schema element: id",...}
EDIT:
I now added secondary indices, but still get the same errors:
