Given the below dynamodb schema for creating the table:
"KeySchema": [
{
"AttributeName": "id",
"KeyType": "HASH"
},
{
"AttributeName": "name",
"KeyType": "RANGE"
}
],
and dynamoose schema in code:
new dynamoose.Schema({
id: {
type: String,
},
name: {
type: String,
},
Was seeing ValidationException: The number of conditions on the keys is invalid
error when using repository.get()
The solution: Need to specify the range key in dynamoose schema.
id: {
type: String,
hashKey: true,
},
name: {
type: String,
rangeKey: true,
},