Options used by InfluxDBClient.default.write .

      client
.write(point, DATABASE, 'cpu', {
headers: {
'channel-lane': 'reserved',
'notify-central': '30m',
},
precision: 'ns',
gzipThreshold: 1000,
noSync: false,
})
interface WriteOptions {
    defaultTags?: { [key: string]: string };
    gzipThreshold?: number;
    headers?: Record<string, string>;
    noSync?: boolean;
    precision?: WritePrecision;
}

Properties

defaultTags?: { [key: string]: string }

default tags

const client = new InfluxDBClient({
host: 'https://eu-west-1-1.aws.cloud2.influxdata.com',
writeOptions: {
defaultTags: {
device: 'nrdc-th-52-fd889e03',
},
},
})

const p = Point.measurement('measurement').setField('num', 3)

// this will write point with device=device-a tag
await client.write(p, 'my-db')
const client = new InfluxDBClient({
host: 'https://eu-west-1-1.aws.cloud2.influxdata.com',
})

const defaultTags = {
device: 'rpi5_0_0599e8d7',
}

const p = Point.measurement('measurement').setField('num', 3)

// this will write point with device=device-a tag
await client.write(p, 'my-db', undefined, {defaultTags})
gzipThreshold?: number

When specified, write bodies larger than the threshold are gzipped

headers?: Record<string, string>

HTTP headers that will be sent with every write request

noSync?: boolean

Instructs the server whether to wait with the response until WAL persistence completes. noSync=true means faster write but without the confirmation that the data was persisted.

Note: This option is supported by InfluxDB 3 Core and Enterprise servers only. For other InfluxDB 3 server types (InfluxDB Clustered, InfluxDB Clould Serverless/Dedicated) the write operation will fail with an error.

Default value: false.

precision?: WritePrecision

Precision to use in writes for timestamp. default ns