Issue with find and get not using the _type
field
#421
calebwilson706
started this conversation in
General
Replies: 3 comments
-
Please follow the issue template. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, that is a limitation. We expect that each model has a unique PK/SK combination. We could apply the _type as a filter, but that is an additional comparison for the vast majority of use cases. You could add that for your use case by a where clause. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the feedback. We really try to respond and fix issues quickly.
Doc is hard …
Can you point areas that need attention with the doc.
Can you help?
Regards
Michael
… I find it interesting that your documentation leaves out so many details, yet you have such a high standard for issues.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
If you have two different models which use the same partitionKey and sortKey then the find and get commands will not respect the model type. For example:
If i had a SuccessfulFoo and FailedFoo models which both had the partition key
ID-${id}
and sort keyFOO_STATUS-${status}
along with other fields specific to the status. then one table's find command would still return someFailedFoos
even if you didsuccessfulFoo.find
I'm aware that the keys could be setup in a better way however I still believe that the find and get commands should automatically apply the same where clause as the scan which is
_type == EXPECTED_TYPE
Sorry for the description, i'm finding it hard to explain but the last sentence should sum it up
Beta Was this translation helpful? Give feedback.
All reactions