trying to get a reference for it using
const { InfluxDB, Point, WritePrecision } = require('@influxdata/influxdb-client');
and then trying;
const influxDbApi = new InfluxDB({url: influxDbUrl, token: influxDbToken}).getWriteApi(influxDbOrg, influxDbBucket, WritePrecision.s);
but getting instead
Cannot read property 's' of undefined
any ideas how I can set a precision?
Hello @bonesoul,
When I do:
const influxDB = new InfluxDB({url, token})
const writeApi = influxDB.getWriteApi(org, bucket, WritePrecision.s)
function writeExample(value){
const point1 = new Point('temperature')
.tag('example', 'index.html')
.floatField('value', value)
writeApi.writePoint(point1)
}
It works for me without errors.
Can you please share your package.json
?
"@influxdata/influxdb-client": "1.2.0"
i’m missing the latest version maybe?
tried your example and getting; ReferenceError: WritePrecision is not defined
I am using
“@influxdata/influxdb-client”: “1.2.0-nightly.9”
Let me know if that helps? Sorry for the delay.