influxdb-client-js

InfluxDB 2.0 JavaScript client

View the Project on GitHub influxdata/influxdb-client-js

Home > @influxdata/influxdb-client > QueryApi

QueryApi interface

Query InfluxDB. Provides methods that notify about result lines of the executed query. See https://docs.influxdata.com/influxdb/latest/api/#operation/PostQuery

Signature:

interface QueryApi 

Methods

Method Description
collectLines(query) CollectLines executes the query and collects all result lines in the returned Promise. This method is suitable to collect simple results. Use with caution, a possibly huge stream of lines is copied to memory.
collectRows(query, rowMapper) CollectRows executes the query and collects all the results in the returned Promise. This method is suitable to collect simple results. Use with caution, a possibly huge stream of results is copied to memory.
iterateLines(query) IterateLines executes the supplied query and returns results in an async iterable of annotated CSV lines. Async iterables are best consumed by for-await loop.
iterateRows(query) IterateRows executes the supplied query and returns results in an async iterable of row data and table metadata pairs. Async iterables are best consumed by for-await loop.
lines(query) Creates a cold observable of the lines returned by the given query.
queryLines(query, consumer) Executes the query and receives result lines (including empty and annotation lines) through the supplied consumer. See annotated-csv.
queryRaw(query) QueryRaw executes a query and returns the full response as a string. Use with caution, a possibly huge stream is copied to memory.
queryRows(query, consumer) Executes the query and receives table metadata and rows through the supplied consumer.
response(query) Response returns an AnnotatedCSVResponse instance that executes the query when asked for data.
rows(query) Creates a cold observable of the rows returned by the given query.
with(options) Returns a new query API with extra options applied.