-
Type: Bug
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Tools
-
None
-
ALL
Mongoimport has flaws in how it handles TSV files, particularly regarding the types of data that are imported.
A simple example to demonstrate:
1) Start with the following sample file represented the exported document
{ a : true }$cat test.tsv
a
true
2) Import this file
$mongoimport -d test -c test -f a --type tsv --file test.tsv --headerline
3) Look at the document
$mongo
>db.test.find()
This document has the value "true" the string, rather than true the boolean.
A issues exists for importing subdocuments where what is imported is a string representation of the subdocument rather than an actual subdocument.
Beyond this, if a string is stored like "string" (where the value is what is inside the quotes), the imported value will be "\"string\"".