-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: mongoexport
-
None
If a document's value for field "foo" is null, and "foo" is in the field list for mongoexport --csv, mongoexport refuses to export that document. The error message is, "Invalid BSON object type for CSV output: 10." Better if mongoexport wrote an empty string or the string "null" instead.
Steps to reproduce:
In mongo shell:
> db.nullcsv.insert({"a":null})
Running mongoexport:
$ ./mongoexport --csv -c nullcsv -d test --fields "a" connected to: 127.0.0.1 a Invalid BSON object type for CSV output: 10 exported 1 records
The same thing happens with deprecated BSON types "DBPointer" and "undefined".
It's unclear what the appropriate action here should be, but a small improvement may just be to improve the error messages to explain better why the failure is happening.
- related to
-
TOOLS-401 csv exported representation of "null" should be a blank string
- Closed