Help querying data influxdb with node-red

Hi everyone, I'm learning right now Node-red and influxdb. I have a project in influxdb where I query or read data from a influxdb db. The query I'm doing is the next:

msg.query = 'from(bucket: "sierradata") |> range(start: -1d, stop: now())'
return msg;

That query is in function and the msg.query message is pass to the influxdb in object from node-red. So that works, it reads 4 objects. The problem is that I'm not reading the values from the measurements of the database. What I'm reading is 4 objects like this:

0: object

result: "_result"

table: 0

_start: "2021-02-09T08:34:43.5651746Z"

_stop: "2021-02-10T08:34:43.5651746Z"

_time: "2021-02-10T08:12:47.857Z"

_value: "sierra"

_field: "type"

_measurement: "datas"

And the datas I'm interested in reading are inside the measurement "datas" and I don't know how to acces or read that data. Those "datas" are:

Time type value


161294... sierra 1
161294... sierra 2
.
.

If anyone can help me I'd really appreciate. Thanks in advance!

Welcome to the forum @Rafa.

There’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

https://nodered.org/docs/user-guide/messages

Also I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.