Optionaldefaultdefault 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})
OptionalgzipWhen specified, write bodies larger than the threshold are gzipped
OptionalheadersHTTP headers that will be sent with every write request
OptionalnoInstructs 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.
OptionalprecisionPrecision to use in writes for timestamp. default ns
Options used by InfluxDBClient.default.write .
Example: WriteOptions in write call