awslabs / dynamodb-data-mapper-js

A schema-based data mapper for Amazon DynamoDB.
https://awslabs.github.io/dynamodb-data-mapper-js/
Apache License 2.0
817 stars 106 forks source link

UPDATED_OLD / UPDATED_NEW Return types? #144

Open mischuler opened 5 years ago

mischuler commented 5 years ago

Is there support for similar return items like in the basic DynamoDB Put/Update/Delete API Calls? I couldn't find any mention of it in the documentation.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.ReturnValues

ReturnValues: ALL_OLD If you update an existing item, ALL_OLD returns the entire item as it appeared before the update. If you update a nonexistent item (upsert), ALL_OLD has no effect.

ReturnValues: ALL_NEW If you update an existing item, ALL_NEW returns the entire item as it appeared after the update. If you update a nonexistent item (upsert), ALL_NEW returns the entire item.

ReturnValues: UPDATED_OLD If you update an existing item, UPDATED_OLD returns only the updated attributes, as they appeared before the update. If you update a nonexistent item (upsert), UPDATED_OLD has no effect.

ReturnValues: UPDATED_NEW If you update an existing item, UPDATED_NEW returns only the affected attributes, as they appeared after the update. If you update a nonexistent item (upsert), UPDATED_NEW returns only the updated attributes, as they appear after the update.

steowens commented 3 years ago

It's too bad that the AWS developers who create the documentation and the API's couldn't exhibit the professionalism that would have led them to explain that which you say above in their documentation or code comments. But if they did that people might start to think that they had coding standards.