0

I'm using dynamodb Local. I'm trying to assign two addresses to one person but I'm getting a "Duplicate Key" error. I want to add more countries and more addresses for one single person. but whenever I try to add another country and address for the person it gives a Duplicate Key error

Can someone pls help me out? Help is appreciated. The image of my localhost code

{
  "AttributeDefinitions": [
    {
      "AttributeName": "AddressID",
      "AttributeType": "S"
    },
    {
      "AttributeName": "CustomerID",
      "AttributeType": "S"
    },
    {
      "AttributeName": "Country",
      "AttributeType": "S"
    }
  ],
  "TableName": "Addresses",
  "KeySchema": [
    {
      "AttributeName": "AddressID",
      "KeyType": "HASH"
    },
    {
      "AttributeName": "CustomerID",
      "KeyType": "RANGE"
    }
  ],
  "TableStatus": "ACTIVE",
  "CreationDateTime": "2021-04-06T09:06:29.622Z",
  "ProvisionedThroughput": {
    "LastIncreaseDateTime": "1970-01-01T00:00:00.000Z",
    "LastDecreaseDateTime": "1970-01-01T00:00:00.000Z",
    "NumberOfDecreasesToday": 0,
    "ReadCapacityUnits": 5,
    "WriteCapacityUnits": 5
  },
  "TableSizeBytes": 732,
  "ItemCount": 6,
  "TableArn": "arn:aws:dynamodb:ddblocal:000000000000:table/Addresses",
  "GlobalSecondaryIndexes": [
    {
      "IndexName": "UserIndex",
      "KeySchema": [
        {
          "AttributeName": "AddressID",
          "KeyType": "HASH"
        },
        {
          "AttributeName": "Country",
          "KeyType": "RANGE"
        }
      ],
      "Projection": {
        "ProjectionType": "ALL"
      },
      "IndexStatus": "ACTIVE",
      "ProvisionedThroughput": {
        "ReadCapacityUnits": 5,
        "WriteCapacityUnits": 5
      },
      "IndexSizeBytes": 732,
      "ItemCount": 6,
      "IndexArn": "arn:aws:dynamodb:ddblocal:000000000000:table/Addresses/index/UserIndex"
    }
  ]
}
2
  • Please share more details, and share everything that could be shared in text form as text Commented Apr 6, 2021 at 11:49
  • @NicoHaase updated. pls check Commented Apr 6, 2021 at 12:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.