You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When performing a GET request providing only the partitionKey against a table that also contains a sortKey results in an error:
please provide the sort key for the attribute name
My table contains
To Reproduce
Steps to reproduce the behavior:
Create a table with a PartitionKey and a SortKey:
`@Model({tableName: 'Sample'})
export class className{
@PartitionKey()
pk: string
public constructor(init?: Partial) {
Object.assign(this, init);
}
}`
Perform a GET request against that table: const sample = await new DynamoStore(Sample).get('myPartitionKey');
Observe the error
Expected behavior
The GET method provides for the SortKey as optional. Other Dynamo libraries allow you to query a single record by PartitionKey only, returning the first record if multiple exist.
The text was updated successfully, but these errors were encountered:
Describe the bug
When performing a GET request providing only the partitionKey against a table that also contains a sortKey results in an error:
please provide the sort key for the attribute name
My table contains
To Reproduce
Steps to reproduce the behavior:
Create a table with a PartitionKey and a SortKey:
`@Model({tableName: 'Sample'})
export class className{
@PartitionKey()
pk: string
@SortKey()
sk: string
name: string;
public constructor(init?: Partial) {
Object.assign(this, init);
}
}`
Perform a GET request against that table:
const sample = await new DynamoStore(Sample).get('myPartitionKey');
Observe the error
Expected behavior
The GET method provides for the SortKey as optional. Other Dynamo libraries allow you to query a single record by PartitionKey only, returning the first record if multiple exist.
The text was updated successfully, but these errors were encountered: