2
votes

I am fighting with updating an item in the DynamoDB table. In the documentation I noticed the next sentence:

UpdateItem – Edits an existing item's attributes. You can also use conditional operators to perform an update only if the item’s attribute values match certain conditions.

I am writing on Objective-C and I cannot find any possibility for developer to set any conditions to the updateItem operation. I need the condition to be applied to the range-key. Has anyone succeeded in conditional updating in DynamoDB?

PS. I cannot instantiate the correct writeBatchItem arguments structure. There is no info in the internet about working with DynamoDB on Objective-C :(

Thanks in advance for any help!

1

1 Answers

3
votes

The documentation states you can update attributes. The key (hash/range) is not an attribute thus cannot be updated.
Regarding the conditional update, read the API reference here: DynamoDBUpdateItemRequest class reference and set the expected values.

If you feel the documentation isn't clear enough you should also look at the Java SDK Reference