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 年前檢視次數 577 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南