How to get validated entity attributes? #420
Unanswered
matteofortier
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following the common design/access pattern of using a transaction to maintain uniqueness on multiple attributes, I wanted to know how I would be able to get an entity object post validation by electroDB.
To elaborate: I have a user entity, with required default attributes such as userId, createdAt and updatedAt, all defined using Entity in electroDB. The user entity also has email and username required attributes, which I want to maintain uniqueness on.
This means when I create a user entity, I must conduct a write transaction that creates the user item, the username item, and the email item. I would like to know how I can obtain those default attribute values such as the generated userId. I understand that DynamoDB Transactions do not return those values, but surely there is a way to obtain those values from electroDB before it is executed by the ddb document client so that I can use those values iff the transaction succeeds? Or perhaps there is a way to validate my object with the electroDB entity?
I understand there is the .param() execution but that returns everything including any hidden attributes or keys.
Any insight or solution would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions