updateMany method

  1. @override
Future<int> updateMany({
  1. required List<T> entities,
  2. Database? database,
  3. int? chunk,
})
override

Implementation

@override
Future<int> updateMany(
    {required List<T> entities, Database? database, int? chunk}) async {
  final Database db = database != null ? database : this.database;

  final queue = Queue(parallel: chunk ?? 500);

  entities.forEach((T entity) {
    queue.add(() => updateOne(entity: entity, database: db));
  });

  await queue.onComplete;

  return 1;
}