exportDatabase method

Future<void> exportDatabase([
  1. String namedb = "export"
])

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');
}