Skip to content

Commit 4d46172

Browse files
authored
Removed querying from Readme
1 parent bbacd33 commit 4d46172

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

README.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -344,43 +344,6 @@ void setup() {
344344
}
345345
```
346346

347-
## Querying
348-
InfluxDB uses [Flux](https://www.influxdata.com/products/flux/) to process and query data. InfluxDB client for Arduino offers a simple way how to query data with `query` function:
349-
```cpp
350-
// Construct a Flux query
351-
// Query will find RSSI for last 24 hours for each connected WiFi network with this device computed by given selector function
352-
String query = "from(bucket: \"" INFLUXDB_BUCKET "\") |> range(start: -24h) |> filter(fn: (r) => r._measurement == \"wifi_status\" and r._field == \"rssi\"";
353-
query += "and r.device == \"" DEVICE "\")";
354-
query += "|> " + selectorFunction + "()";
355-
356-
String resultSet = client.query(query);
357-
// Check empty response
358-
if (resultSet == "") {
359-
// It can mean empty query result
360-
if (client.wasLastQuerySuccessful()) {
361-
Serial.println("Empty results set");
362-
} else {
363-
// or an error
364-
Serial.print("InfluxDB query failed: ");
365-
Serial.println(client.getLastErrorMessage());
366-
}
367-
} else {
368-
Serial.println(resultSet);
369-
}
370-
```
371-
372-
InfluxDB query result set is returned in the CSV format, where the first line contains column names:
373-
```CSV
374-
,result,table,_start,_stop,_time,_value,SSID,_field,_measurement,device
375-
,_result,0,2019-12-11T12:39:49.632459453Z,2019-12-12T12:39:49.632459453Z,2019-12-12T12:26:25Z,-68,666G,rssi,wifi_status,ESP8266
376-
```
377-
This library also provides a couple of helper methods for parsing such a result set.
378-
379-
If the query results in an empty result set, the server returns an empty response. As the empty result returned from the `query` function indicates an error,
380-
use `wasLastQuerySuccessful()` method to determine final status.
381-
382-
Complete source code is available in [Query example](examples/Query/Query.ino).
383-
384347
## Troubleshooting
385348
All db methods return status. Value `false` means something went wrong. Call `getLastErrorMessage()` to get the error message.
386349

0 commit comments

Comments
 (0)