find method

Future<FindResultDto> find(
  1. String collection, {
  2. FetchQuery? query,
})

A page of documents from collection.

At most 1000 rows come back, whether or not you ask for a limit. The API caps every query at that ceiling and applies it as the default when FetchQuery.limit is null - so a find with no query is a request for the first thousand documents, not for all of them. A larger limit is clamped rather than refused.

Nothing is hidden by that: FindResultDto.limit reports the limit actually applied, and FindResultDto.count is the total number of matching documents you are allowed to read - so count greater than data.length means there are more, and FetchQuery.offset walks them.

Implementation

Future<FindResultDto> find(String collection, {FetchQuery? query}) async {
  String url = documentUrl(collection);

  if (query != null) {
    url += query.toQueryParams();
  }

  final res = asJsonObject(await http.get(url), 'A find response');
  return FindResultDto.fromJson(res);
}