var data = {Shop : "Shopename", email : "email@gmail.com", name : "name"},{Shop : "Shopename2", email : "email2@gmail.com", name : "name2"};
var data2exportforexcel =[data];
//wanted data
[{Shop : "Shopename", email : "email@gmail.com", name : "name"},{Shop : "Shopename2", email : "email2@gmail.com", name : "name2"}];
//我得到的数据
[ '{Shop : "Shopename", email : "email@gmail.com", name : "name"},{Shop : "Shopename2", email : "email2@gmail.com", name : "name2"
}“];
尝试替换data2exportforexcel。但是说它不是函数。
我使用mongoxls插件将数据动态地传输到数据变量,以便将其导出到节点js mongodb中的excel
答案 0 :(得分:0)
你试过这个吗?
var data2exportforexcel = [JSON.parse(data)];