Output Data Into CSV

Hello all. I am new to Mongo and am trying to output all data from a table into a CSV, easily consumable by other tools. The CSV output provided to me is overly complex. The general format is:


I did not produce this output myself, but have access to the test database and am just trying to use something like mongoexport to get a more “friendly” output similar to this:

ColumnName0, ColumnName1, ColumnName2
DataValue, DataValue, DataValue

The column name prefacing the data value on each line is causing me some heartburn.

Would appreciate any help.


You should be able to get csv file with --type=csv --out=xyz.csv options of mongoexport
What command you used?In what format you are getting output
Please refer to mongo documentation for more options