InfluxDB 2.0 JavaScript client
Home > @influxdata/influxdb-client > InfluxDB > getWriteApi
Creates WriteApi for the supplied organization and bucket. BEWARE that returned instances must be closed in order to flush the remaining data and close already scheduled retry executions.
Signature:
getWriteApi(org: string, bucket: string, precision?: WritePrecisionType, writeOptions?: Partial<WriteOptions>): WriteApi;
Parameter | Type | Description |
---|---|---|
org | string | Specifies the destination organization for writes. Takes either the ID or Name interchangeably. |
bucket | string | The destination bucket for writes. |
precision | WritePrecisionType | (Optional) Timestamp precision for line items. |
writeOptions | Partial<WriteOptions> | (Optional) Custom write options. |
Returns:
WriteApi instance
Use WriteOptions to customize retry strategy options, data chunking and flushing options. See DEFAULT_WriteOptions to see the defaults.
See also write example, writeAdvanced example, and browser example.