collectionToJson method
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;
}