- Newest
- Most votes
- Most comments
To store each attribute individually, you will need to modify the SQL in your IoT rule to handle each attribute separately.
In your IoT rule, set the SQL statement to the following:
SELECT payload.test1 as test1, payload.test2 as test2, payload.test3 as test3 FROM 'test/topic'
This statement extracts each attribute individually from the payload.
In the action for the rule, select 'Split message into multiple columns of a DynamoDB table (DynamoDBv2)'.
In the 'Configure action' step, select your DynamoDB table and set the Hash key value to your desired key (for example, id).
In the 'Table columns' section, map the incoming payload data to the DynamoDB columns. Use test1, test2, and test3 as the column names and ${test1}, ${test2}, and ${test3} as the values, respectively.
By using this method, the payload from the MQTT message will be split into different attributes in DynamoDB rather than being stored as a map under the payload attribute. Please note that you need to ensure that your DynamoDB table has the appropriate columns (test1, test2, test3) set up for this to work.
Relevant content
- asked a year ago
- asked 2 years ago
- Accepted Answerasked 4 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 5 months ago
Thank you for answer. Is DynamoDBv2 only possible? Is this not possible with DynamoDB?