dynamodb-toolbox
dynamodb-toolbox copied to clipboard
DynamoDB createSet after transform call
We feed arrays to dynamo-toolbox and it converts it to set. But dynamoDB or aws-sdk can't handle empty array.
dymanoDB.createSet([]) // throws error
I tried to mitigate this through transform but transform as following:
{ numSet: {type: 'set', setType: 'number', transform: v => Array.isArray(v) && v.length ? v : null }
But transform runs after createSet which doesn't make sense because then value of transform function is a dynamo set wrapper instead of array which I passed.
Thanks for reporting this. We'll take a look.