-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for LSI/GSI to EntityManager.findOne() #361
Comments
Typedorm should not support findOne() for LSI/GSI because DynamoDB does not allow single-item retrieval using these indexes. The findOne() method is optimized for primary key queries, and including index support would conflict with DynamoDB's inherent functionality and potentially confuse users.
|
Currently
EntityManager.find()
allows for querying against an LSI/GSI by specifying the desired index in thequeryOptions
. As getting a single item by LSI is a common use case in our consuming code, it would be much easier if this method supported it.One potential wrinkle for this request is that
findOne()
currently requires the primary key, and in this instance the sort key is going to be unknown (hence the index query).findOne()
signature might need to be updated toPrimaryKey
|PartitionKey
based onqueryOptions.index !== undefined
.The text was updated successfully, but these errors were encountered: