How to perform update on dynamodb local

Viewed 203

Currently I have a local image of amazon/dynamodb-local . Whenever I try to perform an update operation on the database, it creates a duplicate row instead of updating the existing record

My table definition is:

{
    TableName: "commission",
    KeySchema: [
      { AttributeName: "public_key", KeyType: "HASH" }, //Partition key
    ],
    AttributeDefinitions: [{ AttributeName: "public_key", AttributeType: "S" }],
    ProvisionedThroughput: {
      ReadCapacityUnits: 5,
      WriteCapacityUnits: 5,
    },
  }

Update query generated using NoSQL Workbench:

{
        TableName: "commission",
        Key: {
            "public_key": publickey
        },
        UpdateExpression: "set commission = :commission , commisison_limit = :commissionlimit ",
        ExpressionAttributeValues: {
            ":commission": commission,
            ":commissionlimit": commissionlimit
        },
        ReturnValues: "UPDATED_NEW"

    }
1 Answers

Just a latest development, yesterday I deleted the shared-local-instance.db and re intialized all the tables and everything was working fine. But today when i restarted everything, it is back to the same thing, The first image is when i perform the update now and the second is when i try to delete the duplicate record

The table after i perform the update

If i try to delete the duplicate record, i get this error

Related