我想将MongoDB的collection导出成CVS,在官网文档写可以用mongoexport导出
mongoexport
mongoexport --host localhost --db dbname --collection name --csv > output.csv
但他总警告我指定要导出的字段并无法导出,我要导出所有字段啊,就跟mysql导出cvs那样,怎样忽略他的警告呢?
小伙看你根骨奇佳,潜力无限,来学PHP伐。
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]> ;…
mongoexport -h localhost -d dbname -c collname -f field1,field2 --csv -o output.csv
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]> ;…