Hi friends. I need your supports.
I'm trying to get data from Influx Cloud DB.
Table influxdb:
I use influxdb in node[v2.0] due to "influxdb cloud".
Contain node like below.
from(bucket: "NodeRed")
|> range(start: -1s)
|> filter(fn: (r) => r["_measurement"] == "myData" and r["_field"] == "Makine" and r["_value"] == "M3")
|> sort(columns: ["_time"], desc: true)
|> limit(n: 1)
But it's not useful. After debugging in nodered, rows containing M2 and M3 are also coming. I want to get only the last row containing the M3 value from Influxdb.
In addition I cannot use below query with influxdb in node[v2.0]. I think v2.0 only works with flux query.
"SELECT *
FROM "myData"
WHERE
("Makine" == 'M3')
order by timestamp desc
limit 1"
1- How can I get contain M3 last row with flux query?
2- Is there alternative using above SQL query in nodered?
Thanks in advance.