Closed pmvrmc closed 6 years ago
Sounds reasonable, go for it. Actually, that might be a good default, no flag necessary.
That pull request to the flat library should fix this issue if it get's accepted.
I'll submit shortly a PR to json2csv with the necessary change in this library.
Btw, in the meantime, what I currently do is json2csv({ data: JSON.parse(JSON.stringify(myData)), flatten: true })
A bit hackish but do the job...
Hello community,
What do you think about including and extra flag so that flatten won't flat an object if it is an ObjectId (from mongo)?
I'm having this issue where I pass a ObjectId to the csv export and it flattens it into smaller fields: _bsontype and id (with incomprehensible characters).
If you agree with this I can go forward and create the PR for it.