Skip to content

Commit

Permalink
wip: selecting data from InfluxDB
Browse files Browse the repository at this point in the history
  • Loading branch information
VilemRaska committed Jan 26, 2025
1 parent fd7b1d0 commit 7013035
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GAPP/apps/gapp-server/src/services/cars.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export class CarsService extends InfluxDbServiceBase {
public async getCarsStatus(callsigns: string[]) {
console.log(callsigns);
const query = `from(bucket: "cars")
|> range(start: -48h)
|> filter(fn: (r) => r._measurement == "car_status")
|> filter(fn: (r) => [${callsigns}].includes(r.callsign))
|> last()`;
|> range(start: -24h)
|> last()
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> keep(columns: ["_time", "altitude", "longitude", "latitude", "callsign"])`;

const data = await this.queryAPi.collectRows(query);

Expand Down

0 comments on commit 7013035

Please sign in to comment.