Reputation: 620
I've been pushing records into influxDB from node-red, but Javascript defauls time to milliseconds while influxdb defaults time to nanoseconds.
msg.payload.time = new Date().getTime();
I've fixed the problem by specifying influx's precision before the insert
msg.precision = 'ms';
msg.payload.time = new Date().getTime();
But I already have a lot of existing records in my database where I need to multiply time by 1,000,000 so that the dates aren't stuck in the 1970's.
I tried to fix my existing data by running
UPDATE payloads SET time = (time * 1000000)
but I get the error
ERR: error parsing query: found update, expected SELECT, DELETE, SHOW,
CREATE, DROP, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
So... whre is the UPDATE command? How do you update the time in influxdb without an UPDATE statement?
Upvotes: 2
Views: 2636