gpt4 book ai didi

javascript - 从 Particle Photon Webhook 到 Azure 的 JSON 格式

转载 作者:行者123 更新时间:2023-11-28 18:35:18 26 4
gpt4 key购买 nike

我已连接粒子光子来记录我的体温,然后将事件发布到 Microsoft Azure 的 eventhub。然后我使用流分析将 JSON 文件输出到 Azure 存储(好主意吗?)。

当我尝试使用 <script src="URL"></script> 打开它时通过 HTML,我在浏览器控制台窗口中收到 "Uncaught Syntax error: Unexpected token : " 。我还尝试使用 JSON 格式化程序验证我的 JSON 文件,但出现了很多错误。

这是 JSON 文件:https://pptlbhstorage.blob.core.windows.net/temperature/0_d1e8a2b709b14461b5ac12265f33020b_1.json

通过流分析,我使用以下查询创建了一个作业:

CREATE TABLE pptlbhhub (
coreid nvarchar(max),
data nvarchar(max),
event nvarchar(max),
EventEnqueuedUtcTime datetime,
EventProcessedUtcTime datetime,
measurename nvarchar(max),
PartitionId bigint,
published_at datetime,
subject nvarchar(max),
timecreated datetime,
unitofmeasure nvarchar(max),
value float
);

SELECT
coreid
,event
,EventEnqueuedUtcTime
,EventProcessedUtcTime
,measurename
,PartitionId
,published_at
,subject
,timecreated
,unitofmeasure
,value
INTO
pptlbhstorage
FROM
pptlbhhub;

最佳答案

我的意思是你的文件应该像这样才有效(就像一个数组)。[{"coreid":"1e0041000c47343432313031","displayname":"IoT 作业 3","event":"PublishToEventHub","eventenqueuedutctime":"2016-05-12T08:56:20.5300000Z ","eventprocessedutctime":"2016-05-12T08:56:21.3068971Z","guid":"1e0041000c47343432313031","location":"奥斯陆","measurename":"温度","organization":"Westerdals ACT ","partitionid":0,"published_at":"2016-05-12T08:56:21.0850000Z","subject":"天气","timecreated":"2016-05-12T08:56:21.0850000Z", "unitofmeasure":"F","value":21.0},{“coreid”:“1e0041000c47343432313031”,“displayname”:“物联网作业3”,“事件”:“PublishToEventHub”,“eventenqueuedutctime”:“2016-05-12T08:56:20.5300000Z”,“eventprocessedutctime”:“2016 -05-12T08:56:21.3068971Z","guid":"1e0041000c47343432313031","位置":"奥斯陆","measurename":"温度","组织":"Westerdals ACT","partitionid":0, "published_at":"2016-05-12T08:56:21.0850000Z","subject":"天气","timecreated":"2016-05-12T08:56:21.0850000Z","unitofmeasure":"F", “值”:21.0}, ...]

不像{“coreid”:“1e0041000c47343432313031”,“displayname”:“物联网作业3”,“事件”:“PublishToEventHub”,“eventenqueuedutctime”:“2016-05-12T08:56:20.5300000Z”,“eventprocessedutctime”:“2016 -05-12T08:56:21.3068971Z","guid":"1e0041000c47343432313031","位置":"奥斯陆","measurename":"温度","组织":"Westerdals ACT","partitionid":0, "published_at":"2016-05-12T08:56:21.0850000Z","subject":"天气","timecreated":"2016-05-12T08:56:21.0850000Z","unitofmeasure":"F", “值”:21.0}{“coreid”:“1e0041000c47343432313031”,“displayname”:“物联网作业3”,“事件”:“PublishToEventHub”,“eventenqueuedutctime”:“2016-05-12T08:56:20.5300000Z”,“eventprocessedutctime”:“2016 -05-12T08:56:21.3068971Z","guid":"1e0041000c47343432313031","位置":"奥斯陆","measurename":"温度","组织":"Westerdals ACT","partitionid":0, "published_at":"2016-05-12T08:56:21.0850000Z","subject":"天气","timecreated":"2016-05-12T08:56:21.0850000Z","unitofmeasure":"F", “值”:21.0}...

区别在于流开头和结尾的“[]”以及每个元素之间的“,”。

关于javascript - 从 Particle Photon Webhook 到 Azure 的 JSON 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37214318/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com