deleteMany method

Future<void> deleteMany(
  1. Map<String, dynamic> query
)

Implementation

Future<void> deleteMany(Map<String, dynamic> query) async {
  final List<String> idsToRemove = [];
  for (final id in collection.keys) {
    final document = collection[id];
    if (_matchWithOperators(document, query)) {
      idsToRemove.add(id);
    }
  }
  for (final id in idsToRemove) {
    Task task = Task("remove", () async {
      collection.remove(id);
    });
    harnCollectionQueue.enqueue(task);
    _notifyDocumentDeleted(id);
  }
  // await _saveCollection();
}