How to specify sortkey for dynamodb
How can specify sort key e.g.
type Post @model { id: ID! # id: ID! is a required attribute. title: String! tags: [String!]! }
How can i specify title as sort key ?
@vjindalaurea We don't have that support yet, but we have an RFC for this feature which we're currently working on this feature based off this RFC - #1062
Is there a known workaround? Also, in the above example @model, is the id field mapped to a partition key or primary key?
You cannot set the sort key on the table but you can create indexes with sort keys set using @connection. As mentioned above we are working on improving the indexing experience with DynamoDB and that will be updated in the RFC.
is there an idea when you will support sortkeys?
There is not set release date but updates will be put in this RFC #1062.
We launched support for custom indexes today. You can find docs for the same out here - https://aws-amplify.github.io/docs/cli/graphql#key Please let us know if you're still not able to solve your problem through this solution and we'll re-open this issue for you.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.