Closed bmmathe closed 7 years ago
Thanks for the feedback. Yes, you are right. The current version does not handle array very well. We will work on this in these few days. Please stay tuned.
@jazarja made a fix. I will release that soon after running some test.
@bmmathe can you please download the 0.1.16 version and see if it fixes your issue? Please let me know then I will close this ticket.
@bmmathe does the fix work for you?
Close this ticket as no response from author.
When trying to issue a remove expression when only one item is specified to be removed from a list an empty SET expression is generated.
var removeItem = { "Options": [ { Votes: '0', Name: 'Wheel of Time' } ] }
{ UpdateExpression: 'SET REMOVE #Options', ExpressionAttributeNames: { '#Options': 'Options' }, TableName: 'Polls', Key: { PollId: 'hTB5MG2e', Created: '2016-11-06T03:19:12.788Z' }, ReturnValues: 'ALL_NEW' }
Error JSON: { "message": "Invalid UpdateExpression: Syntax error; token: \"REMOVE\", near: \"SET REMOVE #Options\"", "code": "ValidationException", "time": "2016-11-06T16:04:30.560Z", "requestId": "5f92a91a-f43e-4e08-a556-fee6c54e9dab", "statusCode": 400, "retryable": false, "retryDelay": 0 }
One option could be to find the element index in the array you want to remove and issue a REMOVE expression like:
REMOVE Options[2]