Hi @StreetCruiser,
I'm happy that you managed to write to the influxDB. 🙂
I looked at the influxdb go client on GitHub a little bit deeper. I found the solution for your problem in the section queries (link).
You can use result.Next() to iterate over the query response.
result, err := queryAPI.Query(context.Background(), `from(bucket: "TestBucket") |> range(start: -1h) |> filter(fn: (r) => r["_measurement"] == "metric") |> filter(fn: (r) => r["_field"] == "sampleValue")`)
if err == nil {
// next() to iterate over query result lines
for result.Next() {
// print out result
fmt.Printf("row: %s\n", result.Record().String())
}
if result.Err() != nil {
fmt.Printf("Query error: %s\n", result.Err().Error())
}
Note: you may have to modify the query for your need.
Best regards,
Nick
... View more