Skip to content

Commit

Permalink
Fix #16 adding support for querying multiple field tags
Browse files Browse the repository at this point in the history
  • Loading branch information
vseenivasan committed Sep 29, 2023
1 parent 741308b commit 0de7349
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ It is a REST API, designed to enable the user to use the DNC features for access

## Release History

- v1.1.3 has the following changes:
- Aggregate option not working [#15](https://github.com/mcci-catena/DNC-Std-Plugin/commit/741308b73a2a1c0e0c1f50f71e721835e91d72e1)

- v1.1.2 has the following changes:
- Data not available for the sensor [#14](https://github.com/mcci-catena/DNC-Std-Plugin/commit/fe6fd3f239bc535db96f9f03267a0e484c935f90)

- v1.1.1 has the following changes:
- Update the status code [#12](https://github.com/mcci-catena/DNC-Std-Plugin/commit/feb93806c7ef869bf26fa69da5e932a4bd1f3df8)
- Add Token validation [#13](https://github.com/mcci-catena/DNC-Std-Plugin/commit/1d869cf7457528a949d3486aefb0c4018c459f1c)
Expand Down
12 changes: 10 additions & 2 deletions app/controllers/influx.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,15 @@ exports.readInflux = (indata) => {

const count = indata.id;

var pname = "\""+ indata.sdata+"\"" // parameter
var paramarr = indata.sdata.split(",")

var selparam = ""
for(let i=0; i<paramarr.length; i++){
selparam = selparam + indata.aggfn+"("+paramarr[i]+")"
if(paramarr.length > (i+1)){
selparam = selparam + ","
}
}

let devid = "("
orflg = 0
Expand Down Expand Up @@ -276,7 +284,7 @@ exports.readInflux = (indata) => {
var todtstr = indata.todate.toISOString();

query = ""+indata.server+"/query?db="+indata.db+
"&q=select+"+indata.aggfn+"("+pname+")+"+indata.math+"+from+"+
"&q=select+"+selparam+"+"+indata.math+"+from+"+
"\""+indata.measure+"\""+"+where+"+devid+"+and+time+>=+'"+fmdtstr+
"'+and+time+<=+'"+todtstr+"'+group+by+time("+indata.gbt+"m)"

Expand Down

0 comments on commit 0de7349

Please sign in to comment.