InfluxDB 2.0 JavaScript client
Home > @influxdata/influxdb-client > WriteApi
Asynchronous API that writes time-series data into InfluxDB. This API always buffers points/lines to create batches under the hood to optimize data transfer to InfluxDB server, use flush
to send the buffered data to InfluxDB immediately.
Signature:
interface WriteApi extends PointSettings
Extends: PointSettings
Property | Modifiers | Type | Description |
---|---|---|---|
path | string | HTTP path and query parameters of InfluxDB query API. It is automatically initialized to /api/v2/write?org=... , but it can be changed after the API is obtained. |
Method | Description |
---|---|
close() | Flushes this writer and cancels retries of write operations that failed. |
dispose() | Unlike close, dispose simply quits without trying to flush the buffered data. |
flush(withRetryBuffer) | Flushes pending writes to the server. |
useDefaultTags(tags) | Instructs to use the following default tags when writing points. Not applicable for writing records/lines. |
writePoint(point) | Write point. |
writePoints(points) | Write points. |
writeRecord(record) | Write a line of Line Protocol. |
writeRecords(records) | Write lines of Line Protocol. |