当前位置:网站首页>json根据条件存入数据库
json根据条件存入数据库
2022-08-08 15:55:00 【CSDN问答】
通过MQTT接收到一长串json字符串,如下
{
"d":[
{"tag":"ML1:F","value":50006.00},
{"tag":"ML1:addr","value":11.00},
{"tag":"ML1:Ea_H","value":0.00},
{"tag":"ML1:Ea_M","value":2.00},
{"tag":"ML1:Ea_L","value":1072.00},
{"tag":"A:addr","value":12.00},
{"tag":"A:Ea_H","value":340.00},
{"tag":"A:Ea_L","value":51142.00},
{"tag":"B:addr","value":13.00},
{"tag":"B:Ea_H","value":147.00},
{"tag":"B:Ea_L","value":5534.00},
{"tag":"C:F","value":50002.00},
{"tag":"C:addr","value":14.00},
{"tag":"C:Ea_H","value":0.00},
{"tag":"C:Ea_M","value":2.00},
{"tag":"C:Ea_L","value":26577.00}
],
"ts":
"2022-08-01T13:38:02+0800"}
现在的业务需求是:希望根据tag类型,A/B/C/ML1,每个tag类型的所有数据(一条数据包括:Device(ML1/A/B/C) F addr Ea_H Ea_M Ea_L这些字段)存储一条influxdb数据,如果通过js,具体怎么操作?
边栏推荐
猜你喜欢
[Unity Starter Plan] Making RubyAdventure02 - Handling Tile Maps & Collision
【对线面试官】如何实现去重和幂等
瑞吉外卖学习笔记2
Install Update(Patches) on ESXi
[Online interviewer] How to achieve deduplication and idempotency
ThinkPHP3.2链接带中文参数乱码导致分页数据错误
【Unity入门计划】Unity实例-C#如何通过封装实现对数据成员的保护
湖北钠斯网络数字藏品交易系统
LED显示屏在会议室如何应用
vs2只运行项目中的一个文件
随机推荐
FreeRTOS知识小结
Flutter的实现原理初探
[Unity entry plan] Unity instance - how to protect data members through encapsulation in C#
[Unity entry plan] Use the double blood bar method to control the blood loss speed of the damage area
leetcode/delete the nth node from the bottom of the linked list
Node简介
CS231n: 6 training neural network (2)
sqoop连接MySQL跟本机不一致是为什么
使用FastApi服务解决程序反复调试导致速度过慢的问题(以tsfresh为例)
Chat with wine and chat, build an asynchronous non-blocking (aioredis) real-time (websocket) communication chat system based on Vue3.0+Tornado6.1+Redis publish-subscribe (pubsub) mode
Redis RDB分析系统
Install Update(Patches) on ESXi
groovy基础学习
华为云分布式缓存服务Redis开通及使用规划教程【华为云至简致远】
把酒言欢话聊天,基于Vue3.0+Tornado6.1+Redis发布订阅(pubsub)模式打造异步非阻塞(aioredis)实时(websocket)通信聊天系统
【对线面试官】如何实现去重和幂等
手把手教你uniapp接入聊天IM即时通讯功能-源码分享
Introduction to Recurrent Neural Network (RNN)
Thoroughly understand the volatile keyword and application scenarios, and it is a must for interviews, and Xiaobai can understand it!
10分钟快速入门RDS【华为云至简致远】