I am trying to delete all records which have the attribute "code" from a DynamoDB table. Here my params:
var params = {
TableName: table,
Key:{
"email": "email",
},
ConditionExpression:"attribute_exists(code)",
};
This is the error:
{
"message": "The conditional request failed",
"code": "ConditionalCheckFailedException",
"time": "2021-11-12T09:01:04.205Z",
"requestId": "e1d74c46-86a0-4f14-8c62-186102f2aff3",
"statusCode": 400,
"retryable": false,
"retryDelay": 36.80819226584606
}
An example record looks like this:
email - first_name - last_name - hash - code - confirmed
e@icloud.com - Bob - Mann - $2b$10$5/x6BkCks6ndXSr/GRhLgOPk.ettTv3lYpglbZbGnM7FXPX5VRFCe - undefined - undefined