Influx-ql
Influxdb-nodejs An Influxdb Node.js Client depends on Influx-ql.
Get influx ql
const QL = ;const ql = 'mydb';qlmeasurement = 'http';qlRP = 'default';ql;qlstart = '2016-01-01';qlend = '-3h';qllimit = 10;qlslimit = 5;qlorder = 'desc';qloffset = 10;qlsoffset = 5;qltz = 'America/Chicago';ql;ql;// select "fetch time","spdy","status" from "mydb"."default"."http" where "code" = 400 and "use" <= 30 and time <= now() - 3h and time >= '2016-01-01' order by time desc limit 10 slimit 5 offset 10 soffset 5 tz('America/Chicago')ql;
The enhance where function
const QL = ;const ql = 'mydb';qlmeasurement = 'http'; // select * from "mydb".."http" where "spdy" = '1'ql;ql; // select * from "mydb".."http" where ("spdy" = '1' or "spdy" = '2')ql;ql; // select * from "mydb".."http" where "use" >= 300ql;ql; // select * from "mydb".."http" where ("spdy" = '1' and "method" = 'GET')ql;ql; // select * from "mydb".."http" where ("spdy" != '1' and "method" != 'GET')ql;ql; // select * from "mydb".."http" where ("spdy" = '1' or "method" = 'GET')ql;ql; // select * from "mydb".."http" where (spdy = '1' and method = 'GET')ql;ql; // select * from "mydb".."http" where "spdy" = /1|2/ql;ql; // select * from "mydb".."http" where "method" = 'GET' or "spdy" = '1'ql;ql;qlrelation = 'or'; // select sum("max") from (select max("fetch time") from "mydb".."http" group by "spdy")ql;qlmeasurement = 'http';ql;ql;ql;ql;
Installation
$ npm i influx-ql
Examples
View the ./examples directory for working examples.
API
License
MIT