dynamodb fill empty cells with previous value

0

Hi I've been collecting data from IoT core and transfer it to aws dynamodb for storing the data. if the values didn't change the mqtt will receive an empty string were the cells remains empty. is their a way to fill the empty cells with their previous values? Or should i configure that on the mqtt part. Or can i remove the empty cells somehow?

Thanks!

질문됨 일 년 전285회 조회
2개 답변
1

Its not clear from your question, but I believe you are calling PutItem with only select attributes, as PutItem is a complete overwrite of your data, you are deleting other attributes which you wish to maintain.

PutItem docs.

To overcome that, you should use UpdateItem which will only update the attributed given in the payload. Furthermore, if the item does not exist it will act like a PutItem and write the new item.

UpdateItem docs.

profile pictureAWS
전문가
답변함 일 년 전
0

Hi,

I assume that you are using one of the AWS IoT Core DynamoDB actions in a rule. Both actions use PutItem hence the behavior you observe. As Leeroy mentions, UpdateItem should be used, but you will need to pass the message to a Lambda function first.

An alternative is to use a WHERE clause in the rule to only execute the rule if the string is not empty.

Massimiliano

AWS
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠