I am trying to write data to influx with the Node-Influx Library. I want to write historical data to influx using the timestamp in the data and the timestamp value in influx.
export class DeviceInfluxDbAccessor extends BaseInfluxDbAccessor {
public writeDeviceReading(device: Device) {
const fields = {
timestamp: device.timestamp
voltage1: device.voltage1,
};
this.influx
.writePoints([
{
measurement: "Device",
fields,
},
])
.then(() => console.log(`Wrote ${device.id} status to influx.`))
.catch(err => console.log(err));
}
}
However the timestamp data seams to be overitten by the influx timestamp