Skip to content

How to support nested Loop of object(Not array) #321

@lucaslynn

Description

@lucaslynn
{
    "deviceName1": {
        "values": {
            "current": "220", 
            "voltage": "1"
        }, 
        "ts": 1721789821
    }, 
    "deviceName2": {
        "values": {
            "current": "380", 
            "voltage": "5"
        }, 
        "ts": 1721789822
    }
}

Conver to

[
  {
    "ts":  1721789821,
    "device": "deviceName1",
    "data": [
      {
        "key": "current",
        "value": 220
      },
      {
        "key": "voltage",
        "value": 1
      }
    ]
  },
  {
    "ts":  1721789822,
    "device": "deviceName2",
    "data": [
      {
        "key": "current",
        "value": 380
      },
      {
        "key": "voltage",
        "value": 5
      }
    ]
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions