Mongoexport to CSV file, enclosing string fields in quotes

Viewed 655

We are trying to export Mongo collections to CSV files - for subsequent import into another database. A simple CSV falls down easily, if a string field in Mongo has quotes of its own.

Is there a way to define that export should enclose strings in quotes? Alternatively, is there an (easy) way to define a field delimiter?

Command is pretty straight forward:

mongoexport -u xxx -p yyy --type=csv --authenticationDatabase=admin -d ourDB --noHeaderLine -c ourCollection -f fiel1,field2,field3 -o ourCollection.csv 

Thank you in advance!

--Alex

0 Answers
Related