exportDatabase method
Implementation
Future<void> exportDatabase([String namedb = "export"]) async {
final collectionNames = await listCollectionNames();
final exportData = <String, dynamic>{};
for (final collectionName in collectionNames) {
final collection = _collections[collectionName];
final collectionData = collection?.collection;
exportData[collectionName] = collectionData;
}
final exportDataJson = jsonEncode(exportData);
await _harnFile.writeExportFile(namedb, exportDataJson, 'harndb');
}