Varun Gawande
Varun Gawande

Reputation: 1120

Update DynamoDB item with optional operation

Is the following operation implementable in DynamoDB:
On providing the key,

Basically, an update where we override value of status regardless of additional_info. And optionally unset additional_info as an attribute if a condition is satisfied?

Upvotes: 1

Views: 227

Answers (1)

hunterhacker
hunterhacker

Reputation: 7122

It cannot be done in one call. It also can't be done in a single transaction wrapping the two calls into one, because a transaction can't repeatedly reference the same item.

If you can just make two calls, that's the way to go. If you need it to be somewhat transactional, you'll need to control things in your app. The details depend on your requirements.

Upvotes: 1

Related Questions