Skip to content

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

Open
@SergeyAvd

Description

@SergeyAvd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions