copyCollection method
Implementation
Future<HarnCollection> copyCollection(
String sourceCollectionName, String targetCollectionName) async {
final sourceCollection = collection(sourceCollectionName);
final sourceDocuments = sourceCollection.find({});
final targetCollection = HarnCollection(targetCollectionName, {});
for (final document in sourceDocuments) {
await targetCollection.insert(document);
}
return targetCollection;
}