New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Derived state #688
Comments
Hey @codingnuclei, This is something that we've discussed in the past but haven't reached a final verdict on. @jeremydaly @ThomasAribart wdyt? |
Hey - so I have added quite a few things now to: #689 I think it gives a real flavour of what I am proposing. It is pretty non-intrusive with patterns and existing code. Would really value some feedback as to whether this is something the team wants within the toolbox. 😄 |
This should be possible with |
Hey - yea i was initially hoping to use the From what I can see, the dynamodb-toolbox/src/lib/formatItem.ts Line 63 in e527a1a
dynamodb-toolbox/src/lib/formatItem.ts Lines 108 to 110 in e527a1a
So my understanding is that if the field is not in the response Item then what is declared in the entity makes no difference... Hoping I am missing something :) |
@jeremydaly any thoughts on the above? 😀 |
Hi,
Is it possible to have an entity with derived state?
i.e. if an item in a table has the attributes:
oneStar
twoStar
threeStar
fourStar
fiveStar
. When i do a entity.get() (once has fetch the item) a new attributerating
is calculated based off the numbers stored in the attributes previously mentioned. This derived state should not be saved/exist in the table.I have played around with
default
andformat
etc but have had no joyThe text was updated successfully, but these errors were encountered: