Skip to content
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

Invoke getters for non-existent attributes #447

Open
ides15 opened this issue Nov 7, 2024 · 0 comments
Open

Invoke getters for non-existent attributes #447

ides15 opened this issue Nov 7, 2024 · 0 comments

Comments

@ides15
Copy link
Contributor

ides15 commented Nov 7, 2024

Creating a new issue from here

I'm running into a similar issue, where I want to add an attribute to an existing ElectroDB entity where there are already items in DynamoDB without that new attribute. I want to query for an existing item, and since the new attribute isn't in the existing item, I want ElectroDB to call the get method of that attribute (defaulting that attribute to some value if it doesn't exist in the item)

In @JoshBarr 's case, I think he may be adding the replayedAt attribute to an existing ElectroDB entity (see "even if the attribute does not exist on the Item" in his original question), and expecting to query for existing items and have replayedAt return an empty array (and isReplay return false), since that attribute doesn't exist on the existing items

For example:

  • Create items with this entity
  • Add new attributes onto the entity and query for existing items (like this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant