How to parse JSON values object with numeric key as incrementing time

I have this JSON response that I would like to parse to a flux table:
The body object contains thousands for records.
Ideally I would do something like:

foreach ($json->{'body'} as $key => $value) {
  $arr[] = array("_time" => $key, "_value" => $value[0] );

How can I do this in flux?
This is my best attempt: (but record.get for every row is not ideal)

import "array"
import "experimental/json"
import "experimental"
import "experimental/record"
jsonStr = bytes( v: "{\"body\":{\"1690727139\":[0.059],\"1690730739\":[0]},\"status\":\"ok\"}")
data = json.parse(data: jsonStr).body
experimental.objectKeys(o: data)
  |> (x) => ({_time: time(v: uint(v: string(v: x) + "000000000")), val: display(v: record.get(r: data, key: x, default: [0])[0])}))
  |> array.from()

Hello @Ib2cool,
Unfortunately without proper looping functionality there isn’t a great way to do this.
I’m afraid you’ve found the best solution which I agree isn’t great.
Props for getting some advanced Flux going though.

I would recommend using a client library and a FaaS and pushing the data to InfluxDB once you’ve already parsed it.