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

IncrementBy/decrementBy not working when using array position in attributePath #200

Closed
simonmumenthaler opened this issue Mar 26, 2019 · 1 comment · Fixed by #201
Closed
Assignees

Comments

@simonmumenthaler
Copy link
Contributor

new TransactUpdate(MyModel, partitionKey, rangeKey)
  .operations( update(`myList[0]`).incrementBy(42) )

expected behaviour:
should generate UpdateExpression as follows:

{
   type: 'SET',
   statement: '#myList[0] = #myList[0] + :myList_at_0',
   attributeNames: { '#myList': 'myList' },
   attributeValues: { ':myList_at_0': { N: '42' } },
 }

actual behaviour:
throws Error: Given value must be either Array or Set 42
only updateFunction set() works with indexes in attribute path

@michaelwittwer
Copy link
Member

🎉 This issue has been resolved in version 5.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants