with this setup whenever I try to add an entity I get the following error:
ERROR TypeError: config.sortKey.includes is not a function
at Table.addEntity (/var/task/node_modules/dynamodb-toolbox/dist/classes/Table.js:172:83)
If I remove the Secondary indexes declarations from the entity the error is gone and I can add as normal.
So the following configuration for the entity WORKS:
Seems like this is still an issue in the latest version 0.9.2. I can get it to work by just not setting the property partitionKey and omitting required. But typing wise it is not entirely correct of course.
I have a table with a PK called 'pk' and SK called 'sk' And a GSI where the PK is 'sk' (The same as the default SK) and the SK is 'gsisk'
Table configuration:
Entity configuration:
with this setup whenever I try to add an entity I get the following error:
ERROR TypeError: config.sortKey.includes is not a function at Table.addEntity (/var/task/node_modules/dynamodb-toolbox/dist/classes/Table.js:172:83)
If I remove the Secondary indexes declarations from the entity the error is gone and I can add as normal. So the following configuration for the entity WORKS:
Expected behavior: The entity should be added as normal with the correct secondary index configuration (the global sk as the GSI pk).