Skip to content

Nested attribute projection #1477

Closed Answered by ptejada
crocco95 asked this question in Q&A
Aug 22, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

What you are asking is not possible today. In your backend, you can filter down the houses list using Array.filter() if you still want a list or Array.find() if you only want to get one item. It is also worth mentioning that the ProjectionExpression itself only allows you to specify a path and not a condition like getting the house with id=2 from the list. Unless your list is saved in the right order every time otherwise you will always need to fetch the whole list anyways and do the filtering in your backend.

This is why using paths in the current attributes option does not work. All attribute names included in ProjectionExpression are escaped through the ExpressionAttributeNames option.…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@crocco95
Comment options

@ptejada
Comment options

Answer selected by crocco95
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants