I want to delete two attributes from an item in a DynamoDB table. In the docs and everywhere on the internet it shows removing only one attribute. Is it possible to remove multiple attributes at once from an item in DynamoDB table. If so, how? Below is the code I tried:
const params = {
TableName: process.env.REPORTS_TABLE,
Key: {
ReportId: removeParams.reportId
},
UpdateExpression: 'REMOVE #param1, #param2',
ExpressionAttributeValues: { '#param1': 'StartDate', '#param2': 'EndDate' },
ReturnValues: 'UPDATED_NEW'
};
const res = await updateReport(params);
I get the below error:
ValidationException: ExpressionAttributeValues contains invalid key: Syntax error; key: "#param2"
Is it a restriction from AWS or is there any other way to do this?