Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling EntityManager.delete with only an "ATTRIBUTE_EXISTS" expression throws an error #343

Open
GTRanger opened this issue Apr 21, 2023 · 0 comments

Comments

@GTRanger
Copy link

Actual behavior: the request throws a DynamoDBServiceException with the following message ExpressionAttributeValues must not be empty. Below is an example that reproduces the issue:

await entityManager.delete(
  MyItem,
  {
   id: "1234",
  },
  {
   where: {
     feature: "ATTRIBUTE_EXISTS"
   },
  }
)

Adding logging reveals that TypeDORM creates the following delete request:

{
  TableName: 'MyTable',
  Key: { PK: '1234' },
  ReturnConsumedCapacity: undefined,
  ConditionExpression: 'attribute_exists(#CE_feature)',
  ExpressionAttributeNames: { '#CE_feature': 'feature' },
  ExpressionAttributeValues: {} // <---- DynamoDB doesn't like this
}

Expected behavior: TypeDORM does not create an empty ExpressionAttributeValues and the request does not throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant