Environment:
NodeJS used with "aws-sdk": "^2.1692.0" to test DynamoDB operations
Goal:
To fetch an item in an exsiting table called CUSTOMER_LIST which contains a list of items.
When I used putItem method to store data, it was a success with the given schema,
var params = {
TableName: "CUSTOMER_LIST",
Item: {
CUSTOMER_ID: { N: "001" },
CUSTOMER_NAME: { S: "Richard Roe" },
},
};
And when I want to fetch an item(getItem method), the given schema is,
var params = {
TableName: 'CUSTOMER_LIST',
Key: {
"CUSTOMER_ID": { N: "001" },
},
ProjectionExpression: 'CUSTOMER_NAME',
};
but I end up having an error in the console given below
Error ValidationException: The provided key element does not match the schema
The same error is also thrown out for deletion of an item.
Here's a link from the AWS documentation from where the example has been taken.