Dynamo DB returning incorrect data

I have a dynamodb table that only has 1 record in it. With is this:

{
  "id": {
    "S": "TEST_ID_111"
  },
  "user_id": {
    "S": "TEST_USER_222"
  },
  "createdAt": {
    "N": "1744361212811"
  },
  "updatedAt": {
    "N": "1744361297801"
  }
}

I can verify that is the data in the AWS console. But when using the SDK to fetch value I am getting a different value. I am seeing this:

{
    createdAt: 1744361843193,
    user_id: 'TEST_USER_999',
    id: 'TEST_ID_111',
    updatedAt: 1744361843193
}

My dynamo table is setup with a partition key (id) and a sort_key (user_id). I’m pretty sure I had a row in the table with TEST_USER_999 before but I don’t anymore. I’ve been banging my head for hours on this. I can’t understand why inside the AWS console it shows 1 record but fetching from the SDK returns a different record. And there is only 1 record in that table. I’m tempted to delete the table and re-create it but I’m afraid the issue will go away without me understanding what is happening.

I have verified I am hitting the expected region and table correctly. Does anyone have any ideas?

Read more here: Source link