question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsure of how to use flatten and unwind

See original GitHub issue

So I am trying to use this NPM package and am unsure as to how to use (-F) flatten.

json2csv -i 3153_Avvo_sample.json -F -o test.csv

It appears to work on plain objects, however it does not appear to work on an Array of Objects.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
markwyntercommented, May 29, 2019

Many thanks @juanjoDiaz - fabulous package!

0reactions
juanjoDiazcommented, Feb 12, 2021

Please, read an follow the documentation @nushrivastava

I want to externalize the fields to a property json file. I tried using ‘fieldsConfig’ : ‘params.json’ and ‘config’: ‘params.json’.

Neither of those options is documented nor supported.

json2csv takes a JSON object as config. If you want to use a external file, you just need to load it and parse it.

In node:

const config = require('../../../../config/scanResultRequest.json');
const jsonToCsv = new Parser(config);

or in the browser use fetch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flattening promise chain with readable function name
My goal is to turn every function to have readable clear logic as such. The problem occurs when trying to unwind the nested...
Read more >
$unwind (aggregation)
Deconstructs an array field from the input documents to output a document for each element. Each output document is the input document with...
Read more >
transforming a hierarchy in to a flat file - Designer
Solved: Hi, I want to create a datasource to control access management. It should have a column ... How would you unwind the...
Read more >
How to Be Alone Without Being Lonely
2) Watch what you consume. Pay attention to what you read and watch while at home. If you're practicing social distancing, obsessively reviewing ......
Read more >
How to Fix Forward Head Posture (Nerd Neck)
(Use Google if you are not sure where it is.) ... You can try flattening your tongue to the roof your your mouth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found