collectionToJson method

JsonObject collectionToJson({
  1. required String path,
  2. List<Document> documents = const [],
})

Implementation

JsonObject collectionToJson({
  required String path,
  List<Document> documents = const [],
}) {
  final docsJson = JsonObject();

  docsJson[metaName] = path;
  docsJson[metaDocuments] =
      documents.map(documentToJson).toList(growable: false);

  return docsJson;
}