Closed dermo666 closed 5 years ago
Will get back to you soon.
Wait. You don't need ExpressionAttributeValues property in the update statement. Just removing the property should work.
@4ossiblellc is there a way to pass an array to build up the ExpressionAttributeValues
?
@snolangps There is no way to pass your own array to be used in ExpressionAttributesValue. ExpressionAttributesValue will be calculated automatically based on object attribute changes.
What do you want to achieve actually ?
What are doing now is that we check whether the DUE.getUpdateExpression(existingItem || { id }, item)
returns any ExpressionAttributeValues
- something like this:
const payload = {
TableName: this.tableName,
Key: { id },
...DUE.getUpdateExpression(existingStoreData || { id }, storeData),
};
if (payload.UpdateExpression === '') {
return;
}
await this.dynamoDb.update(payload).promise();`
If you think that is ok you can close this issue.
Close this case. I am not sure if it is better to throw an exception in this case. But, I think the result is the same as this.dynamoDb.update function will throw an exception.
in version 0.1.21 I am getting following error while calling dynamodb update:
ExpressionAttributeValues must not be empty
This is the object it is trying to update:
It seems that this code:
is generating empty
ExpressionAttributeValues
if there is onlyREMOVE
expression.