kaue / jsonexport

{} → :page_facing_up: it's easy to convert JSON to CSV

Home Page:http://kaue.github.io/jsonexport/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need Help : Complex Json Array to CSV

Zozor54 opened this issue · comments

commented

Hi,

I'm trying to convert a large json array to a CSV.

My json array is provided by a mongodb query.
My code :

const stream = mong.getRandomDataWithLimit(10, count); const output = fs.createWriteStream("./data/export/"+name+".csv") stream.pipe(jsonArrayStreams.stringify()).pipe(output);

My CSV doesn't have any header and start at line 3.
What's is wrong please ?

Mentioning in case it help, an online demo with options you can play with, is here:
https://kaue.github.io/jsonexport/demo/

commented

@Zozor54 It would be better if you could provide a sample json to help us understand whats happening.
If you can, please reopen this issue with some extra information