count method

Future<int> count([
  1. String query = ''
])

The number of data points matching the query for this deployment.

A query using REST SQL (RSQL) can be provided.

Implementation

Future<int> count([String query = '']) async {
  String url = (query.isEmpty)
      ? "$dataEndpointUri/count"
      : "$dataEndpointUri/count?query=$query";

  http.Response response = await service._get(url);

  // we expect a number as a string in the response
  var count = service._handleResponse(response).toString();
  return int.tryParse(count) ?? 0;
}