aws sdk js – DynamoDb Multiple Conditional Updates of Non-dependant Attributes
I am using the Javascript SDK for AWS and I am attempting to perform a single update operation on OHLC (Open, High, Low, Close) data and I only want to update the “High” attribute if the new value is higher than the stored value and the opposite for the “Low”.
As far as I can tell, there are 2 options:
- Query the dB to get the current OHLC, calculate the differences, then update the dB again.
- Perform 2 updates, one with the conditional expression for “High” and one for the “Low” conditional expression.
The basis of the question is this: “Can I use the conditionExpression to perform multiple, non-dependant update conditions on seperate attributes?”
Read more here: Source link