0

我正在尝试将传入的 JSON 对象格式化为 JSON 对象到输出中

输入:

{
  "id" : "001",
  "firstArray":[
    {
      "tid" : 9,
       "secondArray":[
         {
            "keep1" : "value1",
            "keep2" : "value2",
            "remove1" : "somevalue1",
            "remove2" : "somevalue2"
         },
         {...}
       ]
     },
     {
      "tid" : 8,
       "secondArray":[
         {
            "keep1" : "value1",
            "keep2" : "value2",
            "remove1" : "somevalue1",
            "remove2" : "somevalue2"
         },
         {...}
       ]
     }
  ]
}

我想过滤这个对象(删除一些无用的属性)并有这样的东西。

输出:

{
  "id" : "001",
  "firstArray":[
    {
      "tid" : 9,
       "secondArray":[
         {
            "keep1" : "value1",
            "keep2" : "value2"
         },
         {...}
       ]
     },
     {
      "tid" : 8,
       "secondArray":[
         {
            "keep1" : "value1",
            "keep2" : "value2"
         },
         {...}
       ]
     }
  ]
}

有人可以帮助我查询或指出正确的方向。谢谢

4

1 回答 1

0

这可以通过自定义 JavaScript 函数来实现。看看:https ://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-javascript-user-defined-functions

于 2017-04-19T16:28:33.470 回答