-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sort key optional, support getItem, deleteItem and exists operat…
…ions with partition key only (#4) Description Makes sort key name optional in TableIndex when specifying TableConfig. This supports table with only partition key configured. getItem, deleteItem and exists now supports operations with only partition key or both keys. Signature for getItem, deleteItem and exists has changed, now they accepts key: DocumentClient.Key instead of pk and sk as separate arguments. async getItem<T>( key: DocumentClient.Key, fields?: Array<keyof T>): Promise<T> example: client.getItem({ id: 'book-123' }); client.getItem({ pk: 'library#books', sk: 'book-123' }, ['id', 'isActive']); Related Issues Issue: #3 How Has This Been Tested Unit tests Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Checklist My code follows the code style of this project. My change requires a change to the documentation. I have updated the documentation accordingly. I have added tests to cover my changes. All new and existing tests passed.
- Loading branch information
Showing
9 changed files
with
131 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.