Can mongoexport --csv export fields with special characters such as a slash?

蓝咒 提交于 2020-01-07 04:51:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!