Allow nested attr paths (dot notation) for exists conditions #288
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #214 by allowing nested
attr
paths (dot notation) forexists
conditions.e.g. currently this:
Generates this (which doesn't work):
With this PR, it will instead generate this (which does work):
The AWS docs suggest that
attribute_exists(a.b.c)
should work but it doesn't, at least not via the JS SDK. I found out about the above syntax and workaround on Stack Overflow!Although I only need this fixed for the
exists
conditions, for completeness it looks like I probably should implement this for thebetween
,in
,begins_with
,contains
,attribute_type
andsize
conditions/operators as well.Keen to hear thoughts!
Just to add - I considered using arrays for nested
attr
paths, e.g.As technically, you could have a valid (non-map) attribute key that is
'a.b.c'
and want to check if that exists.However, I don't think many people use that syntax, and it seems dot notation is assumed as the convention for nested attributes in
checkAttribute()
, and I didn't think it made sense to introduce a different convention here.