list method

  1. @override
Stream<String> list({
  1. int batchSize = 100,
  2. String? prefix,
  3. String matchKey = "entry",
  4. PointId? offset,
})
override

Implementation

@override
Stream<String> list({
  int batchSize = 100,
  String? prefix,
  String matchKey = "entry",
  PointId? offset,
}) async* {
  if (await getCollection() == null) {
    return;
  }

  ScrollResponse r = await points.scroll(
    ScrollPoints(
      collectionName: namespace,
      limit: batchSize,
      withPayload: WithPayloadSelector(
        include: PayloadIncludeSelector(fields: ["id"]),
      ),
      offset: offset,
    ),
  );

  for (final point in r.result) {
    final id = _originalIdFromPayload(point.payload, point.id);
    if (prefix == null || id.startsWith(prefix)) {
      yield id;
    }
  }

  if (r.hasNextPageOffset()) {
    yield* list(
      batchSize: batchSize,
      prefix: prefix,
      offset: r.nextPageOffset,
    );
  }
}