如何导出复杂的json以优于alasql

我有这样的JSON(可能有一些语法错误,我提取并重写了一些私人数据)

"todo-items": [{ "id": 3511710, "company-name": "company1", "author" : "Jon Doe", "tags": [{ "id": 10101, "name": "2.Marketing Sales", "color": "#f78234" }], "creation-date": 20160101 }, { "id": 3511474, "company-name": "company1", "author" : "Jon Don", "tags": [{ "id": 10101, "name": "2.Marketing Sales", "color": "#f78234" }, { "id": 10103, "name": "4.Automotive", "color": "#9b7cdb" }], "creation-date": 20160101 }, { "id": 3511478, "company-name": "company1", "author" : "Peter Jon Doe", "tags": [{ "id": 10101, "name": "2.Marketing Sales", "color": "#f78234" }, { "id": 9706, "name": "3.sales", "color": "#37ced0" }, { "id": 9562, "name": "3.IT", "color": "#37ced0" }], "creation-date": 20160101 }] 

我用xlsx.core库使用alasql将其导出到excel文件。 首先,我从原始json(由teamwork API提供)中删除STATUS,然后将JSON更改为javascript数组

 $.ajax({ type: "GET", url: requrl, headers: {"Authorization": "BASIC " + window.btoa(key + ":xxx")}, success: function(data) { delete data.STATUS; //alert(data); //console.log(data); var arr = $.map(data, function(el) { return el }); //console.log(arr); alasql("SELECT * INTO XLSX('test.xlsx',{headers:true}) FROM ? ",[arr]); }, error: function(response) { alert(response); } }); 

这工作很好,我可以我的json提取作为excel文件,但我有标签对象在这个json的问题..当我将其更改为数组,然后将其保存在Excel中,所有列都可以,除了标签,我只看到[对象] [对象]你能帮我如何将这些标签也正确的数组? 在Excel中最好的是一个标签=一列

编辑:这是所需的输出 – JSON标签中的最大数量将定义列标签的数量(如果是标签标签标签或标签tag2 tags3无关紧要) 标签