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

asked a year ago547 views
1 Answer
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
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions