Skip to content

Single Model fetch retrieve other model values too #194

Answered by mobsense
ganeshan102 asked this question in Q&A
Discussion options

You must be logged in to vote

In general, find will use the properties you provide to create the PK/SK for the query. These properties may be the PK/SK directly or may be other properties that are used in value templates (preferred approach). If PK/SK are provided directly, they take precedence.

find has a special case where if you omit the full SK ingredients for a value template, find will use the leading fixed prefix portion and do a find using begins_with. In this way, you can use partial SK fields where SK is overloaded.

If you provide _type, it is used in the filterExpression which you would see via the log: true param to see the DynamoDB command as per the README. This is not best practice and you should design…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mobsense
Comment options

Answer selected by mobsense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants