influxdb-client-js
influxdb-client-js copied to clipboard
Help me transalate ol InfluxQL query to Flux
Hello all,
I have started using the InfluxDB 2.x and currently facing problem in understanding the whole flux way of querying the data. In the earlier version in the WHERE clause I could use AND operator and enforce the condition for data what I am looking for for example SELECT "field1",field2,field2" FROM "MEASUREMENT_x WHERE "field1">='condition1' AND "field1" <= 'condition2' AND "field2" >= 'condition3' but unfortunately I am unable to translate the same query with flux. Can someone help me understand the flux query and how I can translate.
Flux query
from(bucket: "some-bucket") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "MEASUREMENT_x") |> filter(fn: (r) => r["_field"] == "field1" and r["_field"] == "field12" and r._value >= 12 and r._value <= 100 and r["_field"] == "field3" and r._value >= 0 and r._value <= 100 ) |> yield()
Thank you in advance!!