A DynamoDB library to ease the use of modeling complex hierarchical relationships and implementing a Single Table Design while keeping your query code readable.
MIT License
1.03k
stars
67
forks
source link
Numeric sort key being ignored when building query params on a query operation. #308
Describe the bug
I am currently trying to migrate an existing project to electrodb. We have existing datasets with attributes as indexes. Whenever the sort key is numeric, the parameters that are sent to dynamo ignore the SK. If you switch the attribute type of the sort key to a string, it builds the dynamo expression correctly.
src/entity.js, the if statement on line 2725 appears to delete the Sk if the keyExpressions.ExpressionAttributeValues[":sk1"] is not of type string.
Is this intended?
ElectroDB Version
Specify the version of ElectroDB you are using
2.10.1
Expected behavior
While using existing datasets with attribute as index, the expression sent to dynamo is ignoring string sort keys on an query operation. Expected it to send the sort key expression if specified.
Describe the bug I am currently trying to migrate an existing project to electrodb. We have existing datasets with attributes as indexes. Whenever the sort key is numeric, the parameters that are sent to dynamo ignore the SK. If you switch the attribute type of the sort key to a string, it builds the dynamo expression correctly.
src/entity.js, the if statement on line 2725 appears to delete the Sk if the keyExpressions.ExpressionAttributeValues[":sk1"] is not of type string.
Is this intended?
ElectroDB Version Specify the version of ElectroDB you are using 2.10.1
ElectroDB Playground Link https://electrodb.fun/?#code/JYWwDg9gTgLgBAbzgUQHY2DAnnAvnAMyghDgHIBTAGwoGMZiATAIzIG4AoWiVAZ3hgBDZjTgBecmCYBXerwC0MCv3YcOFAB6RYcbn3hSIjWTF7i4qCgHcU6TFgAUHOImcu4II9QBcr9+4o7bF8yQ2M5MgAaN38ANwooXmAeEIBGKJj3XgTY4FoKEP5BKDJM3Gj-QRgGYGZpJV5fBEyXMJMAfW5GAr9-d2wwHrJ+KGBUAHNSvrwKvrb6duBGJpb+rEGQ1GkQZgSpvtwy2Zcx7o1lFemoOmhl3umwAGtL6fcCYGo70JkFrooM17ubjgCBJJS+ADa3yMHT+ZAAusdXkpwFQqkMACQIeYwTpeXAAwG6QRJCYhaRgQYlVYuco0uC8Z73V7vT4hHGLRiEwHAyBgnpQjlLBFI6YosBo8HkLFCxgE+mHaaK9zKukuJBCEQUPAcACUnC4PH4cDAxUEIDMEmarR+uL+IQAIgBZADChNlvlSACYAMwcXAGnG8AB0AEdpAksMHrtwoIwHKaoObeLrg4nkw59UA
Entity/Service Definitions
Expected behavior While using existing datasets with attribute as index, the expression sent to dynamo is ignoring string sort keys on an query operation. Expected it to send the sort key expression if specified.
Numeric Sort Key
String Sort Key
Errors
Additional context We are using existing tables with attributes as indexes.