I'm using this module: https://github.com/nulltask/express-csv (also tried a couple more)
MyModel.find(mquery,function(err, list){
if(err){
console.log(err);
var response = {
success: false,
data: null
};
res.json(response);
}else{
console.log(list);
res.setHeader('Content-disposition', 'attachment; filename=mylist.csv');
res.csv(list);
}
});
The problem is what is rendered in the csv file. It is Mongoose's Model itself. But on the console logs the actual data.
Any hints?
Update
Apparently static JSON data it is rendered in the CSV file, so must be something with syncing....