Export array of documents from MongoDB in csv -
i'm working on java program pass mongodb neo4j. have export mongo documents in csv file. have, example, document:
"coached_team" : [ { "team_id" : "pal.00", "in_charge" : { "from" : { "day" : 25, "month" : 9, "year" : 2013 } }, "matches" : 75 } ]
i have export in csv. read other questions, example this , used tip export document.
to export in csv use command:
z:\path\to\mongo\3.0\bin>mongoexport --db <database> --collection <collection> --type=csv --fields coached_team.0.team_id,coached_team.0.in_charge.from.day, coached_team.0.in_charge.from.month,coached_team.0.in_charge.from.year, coached_team.0.matches --out "c:\path\to\output\file\output.csv
Comments
Post a Comment