0

I am try to convert Meteor.user() to Flat CSV File using harrison:papa-parse. but the profile Object is shown as [Object object] in CSV.

I need little guidance where I am getting things wrong?

Below is the template.js events code,

var data = Meteor.users.find({}).fetch();
var csv = Papa.unparse(data);
var now = moment().format('DD-MM-YYYY');
var blob = new Blob([csv],  {type: "text/csv;charset=utf-8"});
saveAs(blob, "User_Report_"+now+".csv"); 

Thanks and respect in advance.

Ankur Soni
  • 5,725
  • 5
  • 50
  • 81

1 Answers1

0

Papa-parse does not support deeply nested structures, as you can see e.g. here. You need to write your own function to traverse the object tree.

tomsp
  • 1,797
  • 14
  • 17