I have a DynamoDB table with few fields:
Path (String,key)
FirstSeen,LastSeen (Date)
UsageCounter (Number)
After creating the table I initialize it with few Items.
I set default values to FirstSeen, LastSeen and UsageCounter.
The default value of UsageCounter is zero.
Later on (using python,boto3 and for a given Path value), I want to increment the value of UsageCounter by X, set the value of LastSeen to be “now” and set the value of FirstSeen to be “now” (only if UsageCounter is zero).
I dont want to go to DB twice. I want that UpdateExpression will take care of it.
Until now I did not find the way to express the above.
Thanks