我想将MongoDB的collection导出成CVS,在官网文档写可以用mongoexport
导出
mongoexport --host localhost --db dbname --collection name --csv > output.csv
但他总警告我指定要导出的字段并无法导出,我要导出所有字段啊,就跟mysql导出cvs那样,怎样忽略他的警告呢?
天蓬老师2017-04-21 11:18:33
You must add an option to specify the fields you want to export. Mongodb will not select all fields for you by default, so you should add --fields <field1[,field2]>, -f <field1[,field2]> ;…
怪我咯2017-04-21 11:18:33
mongoexport -h localhost -d dbname -c collname -f field1,field2 --csv -o output.csv