You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We just started using typedorm and couldn't understand why our entity manager would always return a valid object even though there was no document with that partition key inside our table:
Of course we were not giving the partition key an interpolation variable making it constant. Changing to {{keyHash}} lead to the expected behavior.
I'm still wondering whether this can be avoided by requiring the partition key to include at least one interpolation variable. For example, the library could throw an exception if the replace inside parseKey did not happen. I've created an experimental branch in my fork. The tests are still failing for issue-235.spec.ts because the sort key is constant. But we could allow that probably.
Other solution
Rename primaryKey to primaryKeyPattern to make the intention clear, but it's probably not desirable to introduce a breaking change for this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We just started using typedorm and couldn't understand why our entity manager would always return a valid object even though there was no document with that partition key inside our table:
Of course we were not giving the partition key an interpolation variable making it constant. Changing to
{{keyHash}}
lead to the expected behavior.I'm still wondering whether this can be avoided by requiring the partition key to include at least one interpolation variable. For example, the library could throw an exception if the replace inside
parseKey
did not happen. I've created an experimental branch in my fork. The tests are still failing for issue-235.spec.ts because the sort key is constant. But we could allow that probably.Other solution
Rename
primaryKey
toprimaryKeyPattern
to make the intention clear, but it's probably not desirable to introduce a breaking change for this.Beta Was this translation helpful? Give feedback.
All reactions