performDocumentDeleteBySearch method

  1. @override
Future<void> performDocumentDeleteBySearch(
  1. DocumentDeleteBySearchRequest request
)
override

Implementation

@override
Future<void> performDocumentDeleteBySearch(
  DocumentDeleteBySearchRequest request,
) async {
  final result = await performDocumentSearch(
    DocumentSearchRequest(
      collection: request.collection,
      query: request.query,
      reach: request.reach,
    ),
  ).last;
  for (var snapshot in result.snapshots) {
    await performDocumentDelete(DocumentDeleteRequest(
      document: snapshot.document,
      mustExist: false,
      reach: request.reach,
    ));
  }
}