DynamoDB client for NodeJS and browser with a fluent api to build requests. We take care of the type mapping between JS and DynamoDB, customizable trough typescript decorators.
Describe the bug
It is impossible to use @PartitionKey({ name: 'someOtherName' }), @PartitionKey and @GSISortKey decorators alongside each other, as dynamo-easy complains about the lack of primary key identifier.
To Reproduce
Steps to reproduce the behavior:
// ...
class CoolModel {
// ...
@PartitionKey()
@GSISortKey('gsiName')
@Property({ name: 'entity' })
readonly id: string = genid()
// ...
}
const store = new DynamoStore(CoolModel)
const cool = new CoolModel({ /* ... */ })
store.put(cool).exec()
A code similar to the one above generates the following error:
ValidationException: One or more parameter values were invalid: Missing the key entity in the item
at Request.extractError (<local-path>\node_modules\aws-sdk\lib\protocol\json.js:51:27)
at Request.callListeners (<local-path>\node_modules\aws-sdk\lib\sequential_executor.js:106:20)
at Request.emit (<local-path>\node_modules\aws-sdk\lib\sequential_executor.js:78:10)
at Request.emit (<local-path>\node_modules\aws-sdk\lib\request.js:683:14)
at Request.transition (<local-path>\node_modules\aws-sdk\lib\request.js:22:10)
at AcceptorStateMachine.runTo (<local-path>\node_modules\aws-sdk\lib\state_machine.js:14:12)
at <local-path>\node_modules\aws-sdk\lib\state_machine.js:26:10
at Request.<anonymous> (<local-path>\node_modules\aws-sdk\lib\request.js:38:9)
at Request.<anonymous> (<local-path>\node_modules\aws-sdk\lib\request.js:685:12)
at Request.callListeners (<local-path>\node_modules\aws-sdk\lib\sequential_executor.js:116:18) {
message: 'One or more parameter values were invalid: Missing the key entity in the item',
code: 'ValidationException',
time: 2020-02-27T12:31:16.675Z,
requestId: '--x--',
statusCode: 400,
retryable: false,
retryDelay: 6.40678295655337
}
Expected behavior
The library should track the updated name and act accordingly, regardless of being a key.
Desktop (please complete the following information):
OS: Windows 10
node.js 12.13.1
typecript 3.8.2
Version 5.6.0
Additional context
I've noticed the existence of issue #215 , which seems to be identical to this one. It says it has been released, but I am getting a similar issue... has this been reintroduced?
If I just change id to entity, code immediately works.
Describe the bug It is impossible to use
@PartitionKey({ name: 'someOtherName' })
,@PartitionKey
and@GSISortKey
decorators alongside each other, asdynamo-easy
complains about the lack of primary key identifier.To Reproduce Steps to reproduce the behavior:
A code similar to the one above generates the following error:
Expected behavior The library should track the updated name and act accordingly, regardless of being a key.
Desktop (please complete the following information):
Additional context I've noticed the existence of issue #215 , which seems to be identical to this one. It says it has been released, but I am getting a similar issue... has this been reintroduced?
If I just change
id
toentity
, code immediately works.