Hello
Sohan from the Alexa IN team. Is there a way to use a custom primary key for dynamoDB? Currently the ask-sdk uses userId as the default but was wondering if we could use deviceID as a primary key.
Tried Googling and looking at the docs but couldn't find a definitive answer.
Thanks in advance!
Sohan I just wrote a blog post in Japanese about this. You can override the default values with the PersistenceAdapter.
Here鈥檚 the RTD entry for it. You have to use the custom SkillBuilder.
https://ask-sdk-for-nodejs.readthedocs.io/en/latest/Managing-Attributes.html?highlight=DynamoDbPersistenceAdapter
Hey @sohanmaheshwar , as @SleepyDeveloper pointed out, the partitionKeyGenerator function in the DynamoDb Persistence adapter configuration is used by the SDK to populate the primary key value in the DynamoDb tables. It is defaulted to userId, but you can override this with any value you need. Does this help?
Oh that's great and exactly what I was looking for. Thanks @SleepyDeveloper and @nikhilym
Closing the issue.
Most helpful comment
Sohan I just wrote a blog post in Japanese about this. You can override the default values with the PersistenceAdapter.
Here鈥檚 the RTD entry for it. You have to use the custom SkillBuilder.
https://ask-sdk-for-nodejs.readthedocs.io/en/latest/Managing-Attributes.html?highlight=DynamoDbPersistenceAdapter