I have two DynamoDB tables. I have a use-case where I need to increment an attribute (say rank) in table 1 and use the updated rank value to create an entry in table 2.
If I use transaction write feature in Dynamodb, I don't think there is a way to return the updated value from transaction item 1 and use it to transaction item 2.
Can anyone please let me know how to solve this?
Example: Table 1 has the record - <UniqueId, 2>
During transaction update, I want to update Table 1 record as <UniqueId, 3> and create an entry in Table 2 with record as <CustomerId, 3>
Thanks in advance.
You cannot do this as a single transaction.
You can use use this pattern:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.