performDocumentUpdateBySearch method

  1. @override
Future<void> performDocumentUpdateBySearch(
  1. DocumentUpdateBySearchRequest request
)
override

Implementation

@override
Future<void> performDocumentUpdateBySearch(
  DocumentUpdateBySearchRequest request,
) async {
  final result = await performDocumentSearch(
    DocumentSearchRequest(
      collection: request.collection,
      query: request.query,
      reach: request.reach,
    ),
  ).last;
  for (var snapshot in result.snapshots) {
    await performDocumentUpdate(DocumentUpdateRequest(
      document: snapshot.document,
      data: request.data,
      isPatch: request.isPatch,
      reach: request.reach,
    ));
  }
}