I'm exporting documents of collection called team in MongoDB as csv file. For example I have this MongoDB document:
{
"_id" : "149",
"official_name" : "yaChAaoiqn",
"common_name" : "VMlEXjTOZE",
"country" : "YSpbYyPWSo",
"championship" : "rwSbupqsln",
"uniform" : [
"first_colour",
"second_colour",
"third_colour"
]
}
I use the following command to export documents in csv:
Z:\Program Files\MongoDB\Server\3.0\bin>mongoexport --db paul --collection team
--type=csv --fields _id,official_name,common_name,country,championship,"uniform[0]","uniform[1]","uniform[2]" --out "C:\path\to\outputFile\output.csv"
This is the csv I have in output:
_id,official_name,common_name,country,championship,uniform[0],uniform[1],uniform[2]
149,yaChAaoiqn,VMlEXjTOZE,YSpbYyPWSo,rwSbupqsln,"","",""
The csv file tells me there are some problems with uniform.
How must I set the uniform field in the command to export from MongoDB rightly an array?