Why is the number 0 saved as Null(true) in DynamoDB sometimes?

0

I have a DynamoDB data model where I've set the default value to a particular field explicitly as the number 0 on item generation, which is done in Flutter. The new item is sometimes saved correctly, but not always. The number 0 is occassionally replaced with Null(true), which is a completely different AttributeValue according to my understanding of the Rust AWS SDK. This impacts the requirement to .uwrap() something from .get() from the same data table in my lambda function, but I am not sure what the difference is caused by and hence having trouble figuring out how best to solve.

The field is not a required field, but is always defaulted.

// imported model
class Donate {
  final int? _timstamp;
  ...


// initialization code
  final donate = aws.Donate(
    timstamp: 0
    ...

This results in the s/s attached.Enter image description here

已提问 1 年前578 查看次数
1 回答
0

Hello,

Thank you for using the AWS DynamoDB service.

From the question, I understand that you are observing that occasionally the integer value '0' is saved as "NULL" in one of your DynamoDB data model which later impacts the lambda function and wants to know how to overcome this issue as it happens with random records.

To better assist you on this issue, we would like to replicate the scenario and identify the root cause of this random behavior with integer value 0 for your DynamoDB data model. As this medium is not the best place to ask for your code snippet and other configurations details that you are using at your end, so I'd recommend you to please open a Support case with our Support engineer team so that the DynamoDB engineer can assist you in identifying the root cause of the issue. To open a support case with AWS using the link: https://console.aws.amazon.com/support/home?#/case/create

AWS
支持工程师
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则