Remove updated attributes with AttributeTransformer before saving
When saving an object with DynamoDBMapper, AttributeTransformer can be used to add new values to the item to be saved, or modify existing values, but the problem is that it cannot delete them. As long as an attribute is present and non-null in the initial object passed to DynamoDBMapper.save, it will always present in the saved item, regardless of the return value of AttributeTransformer.
Our use case is that, an attribute needs to be transformed into several values before saving, but the original attribute itself should disappear. The "disappear" step cannot be achieved with current implementation of DynamoDBMapper.
A possible way to solve this is to allow null values in the returned Map from AttributeTransformer, and these null values will be removed from updating attributes if present.
This looks like a feature request. We are actively working on high level libraries for SDK v2 and not currently adding new features in v1 high level libraries. If you can send us a PR, we are happy to take a look
OK. It seems that the new SDK v2 doesn't have any clear plan for high level APIs right now, so I'll see if I can find some time to work on this in v1.
Hi @debora-ito. Can I give this a try?
This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to provide a comment or open a new issue.