many<T> method

Future<void> many<T>(
  1. List<T> objects, {
  2. String? subcollection,
})

Creates multiple documents in Firestore from a list of objects. Uses a batch operation for efficiency.

Implementation

Future<void> many<T>(List<T> objects, { String? subcollection }) async {
  if (objects.length > 500) {
    throw ArgumentError('Batch limit exceeded. Maximum 500 objects allowed.');
  }
  RDBWriteBatch batch = RDBWriteBatch();
  return batch.create(objects, subcollection: subcollection);
}