Skip to content
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

Updating an item with rangeKey=0 (Number) #58

Open
SergeyAvd opened this issue Apr 27, 2019 · 0 comments
Open

Updating an item with rangeKey=0 (Number) #58

SergeyAvd opened this issue Apr 27, 2019 · 0 comments

Comments

@SergeyAvd
Copy link

SergeyAvd commented Apr 27, 2019

I've tried to update an item in my table. The table's HASH and RANGE keys are both numbers. In my case RANGE key was 0. I've received an error:

UnhandledPromiseRejectionWarning: ValidationException: The provided key element does not match the schema

Relevant code in table.js:

var rangeKey = data[self.schema.rangeKey] || null;

How to reproduce this issue:

  1. Create a table with RANGE key as a number;
  2. Run update request with range key 0:
    DynamoDBItem.update({hash: 123, range: 0}).

Note: Event.create can save items with range key being zero.

As a result I cannot update an item with rangeKey=0 using this module. I'll have to go with AWS.DynamoDB.DocumentClient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant