DynamoDBMapper updateItem expression

517 Views Asked by At

I'm using DynamoDBMapper as an abstraction over dynamodb operations in java.

I need to perform an update item within a transaction that depends on the current value (i.e. I need to decrement an account balance). While I know how to do this with the raw dynamodb sdk, it looks like (sadly) the dynamodb mapper does not support update expressions.

Can someone please point me to an example using an update expression that uses "ADD" with a DynamoDBMapper or confirm that it does not support these kind of update expressions?

Thanks

1

There are 1 best solutions below

0
On

You have to set a flag on the Mapper.

DynamoDBMapperConfig(SaveBehavior.UPDATE);

This SO post explains it well