amazon-dynamodb - Create rule in AWS IoT core to insert data into an existing row in DynamoDB
问题描述
When data is sent from my thing to AWS, it will be a string with several values separated by spaces. One of these values is the ID of the device, that I want to use to query the database and insert the data into that row. How can I do this?
解决方案
仅使用单个主题规则可能会很棘手,因为主题规则主要用于 JSON 数据。您可以处理非 json 数据,但您的选择是有限的。您始终可以从主题规则触发 lambda 函数。然后,lambda 函数可以轻松解析消息并写入 DynamoDB。
有关如何在 IoT 主题规则中处理非 JSON 数据的信息,请参阅https://docs.aws.amazon.com/iot/latest/developerguide/binary-payloads.html 。
推荐阅读
- php - 在 Intelli 中用于 .blade.php 文件的 Emmet
- python - Python:将文件复制到 USB 驱动器 - 线程比同步慢
- docker - 在 windows server 2016 1607 上使用 Docker linux 容器
- django - Admin中多对多连接表的Django注册视图
- c++ - IncrediBuild - 错误:字符串的第一个字符应为“0”或“1”
- angular - Angular TypeError('readdirp: root argument must be a string.')
- c++ - 在 OpenGL 的“原始组装”阶段会发生什么
- single-sign-on - 使用 cypress 进行 E2E 测试 - Azure AD 单点登录
- nativescript - 如果有较新版本,提示用户更新应用程序
- sql - 如何在 SAP HANA 的动态 sql 中使用表变量?