问题
mongoexport v2.6.4, when used with --csv, seems to ignore fields with slashes in them and emit an incorrect CSV header row:
mongoexport ... --csv -f 'id,meta.og/url,meta.twitter/url'
outputs the CSV header row
id,meta.og
The mongo shell has no problem isolating fields with slashes in them.
Any ways to work around this without pulling the entire JSON document?
回答1:
The solution that worked was to use a field file with the --fieldFile
option.
来源:https://stackoverflow.com/questions/29887965/can-mongoexport-csv-export-fields-with-special-characters-such-as-a-slash