-
Type:
Improvement
-
Resolution: Done
-
Priority:
Trivial - P5
-
None
-
Affects Version/s: 1.1.1
-
Component/s: Tools
-
None
-
Environment:Mac OS X
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
The usage for mongoexport is not quite right.
It basically tells you to use "-f=field1,field2" when using --csv, but it only accepts "-f field1,field2"
Sorry to be so pedantic
pinocchio:~ oliver$ mongoexport --help
export options:
--help produce help message
-h [ --host ] arg mongo host to connect to
-d [ --db ] arg database to use
-c [ --collection ] arg collection to use (some commands)
-u [ --username ] arg username
-p [ --password ] arg password
--dbpath arg directly access mongod data files in this path,
instead of connecting to a mongod instance
-v [ --verbose ] be more verbose (include multiple times for more
verbosity e.g. -vvvvv)
-q [ --query ] arg query filter, as a JSON string
-f [ --fields ] arg comma seperated list of field names e.g. -f=name,age
--csv export to csv instead of json
-o [ --out ] arg output file; if not specified, stdout is used
pinocchio:~ oliver$ mongoexport -d services -c suppliers -f=name,city --csv
connected to: 127.0.0.1
csv mode requires a field list
pinocchio:~ oliver$ mongoexport -d services -c suppliers -f name,city --csv
connected to: 127.0.0.1
name,city
...