InfluxDB 2.0 JavaScript client
Home > @influxdata/influxdb-client > QueryApi > collectRows
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.
Signature:
collectRows<T>(query: string | ParameterizedQuery, rowMapper?: (values: string[], tableMeta: FluxTableMetaData) => T | undefined): Promise<Array<T>>;
Parameter | Type | Description |
---|---|---|
query | string | ParameterizedQuery | query |
rowMapper | (values: string[], tableMeta: FluxTableMetaData) => T | undefined | (Optional) maps the supplied row to an item that is then collected, undefined return values are not collected. If no rowMapper is supplied, row => tableMeta.toObject(row.values) is used. |
Returns:
Promise<Array<T>>
Promise of mapped results