是否可以通过Denodo中的REST-Webservice交付阵列?

时间:2019-05-07 11:58:06

标签: arrays json rest flatten denodo

我正在Denodo中导入一个JSON数据源,其中包含2个数组。为了处理数据,我将这些数组展平。但是,在传递数据时,我想回到初始数组结构来获得类似的信息

{
  "name": "name_of_my_view",
  "elements": [
    {
      "result": [
        {
          "id": 40033495,
          "first_name": Max,
          "last_name": Mustermann
        },
        {
          "id": 39960791,
          "first_name": "Markus",
          "last_name": "Markwart"
        }
      ],
      "took_ms": 4,
      "result_count": 323,
      "errors": [
        {}
      ]
    }
  ],
"links": [
    {
      "rel": "self",
      "href": "https://address"
    }
  ]
}

我已将两个数组(结果,错误)弄平,以便编辑其中的各个标志。但是我只看到使用UNION组合它们的选项。如果这样做的话,我最终将所有重载都放在一个层次结构中,例如(忽略此示例中的排序)哦,请注意,“ code”和“ description”位于“ error”数组之内,在上述示例中未显示,因为没有错误:

{
  "name": "name_of_my_view",
  "elements": [
    {
      "took_ms": 4,
      "result_count": 323,
      "code": null,
      "description": null,
      "id": null,
      "first_name": null,
      "last_name": null
    },
    {
      "took_ms": 4,
      "result_count": 323,
      "code": null,
      "description": null,
      "id": 40033495,
      "first_name": null,
      "last_name": null
    }
    ],
"links": [
    {
      "rel": "self",
      "href": "https://address"
    }
  ]
}

0 个答案:

没有答案