-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Nested Attributes in Dynamoose #1589
Comments
Do you need to block it, or can you set a preference of taking properties with a dot in their name over nested objects. I think that some responsibility should be put onto the user defining their data models, its quite easy to avoid the situation where we have something like the below I think.
When performing an action on the model, we can do an iterative check against the dots, with a preference of taking keys with dots in them first. e.g.
I haven't checked the code so I'm sorry if this isn't too applicable, it was just a thought I had when looking through the docs / trying to use nested keys. |
Hey y'all, any update on being able to set nested attributes within a map? I have the schema correctly but still can't do set mapname.attribute. It just creates "setname.attribute" in the db. Looking through the docs and issues here I haven't found any solutions here. |
Nested Attributes aren't living up to what users expect in Dynamoose. Almost anytime you want to reference a nested attribute in Dynamoose, it fails. This includes conditional logic, updating a nested attribute, projected attributes (only returning a nested attribute from an item), etc.
From a syntax perspective, it's possible to represent these nested attributes using a
.
. However, the question then becomes what if a non nested attribute has a.
in its attribute name. Dynamoose somehow has to be smart enough to handle that.We could of course block usage of
.
's in attribute names, but that would be a breaking change. Additionally, it would be a breaking change without recourse for users (ie. there'd be no way around it).Any feedback here would be greatly appreciated. How should Dynamoose handle this? How should we handle the edge cases that get exposed here?
One more side note, we do represent nested attributes in
saveUnknown
using.
's. Which I'm not sure was thought about enough in terms of edge cases.References:
update
an item map attributes instead of replacing the map #665The text was updated successfully, but these errors were encountered: