[SERVER-9015] Mongoimport for TSVs does not understand types correctly Created: 18/Mar/13  Updated: 10/Dec/14  Resolved: 18/Mar/13

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Andrew Emil (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates TOOLS-67 Give mongoimport of CSV/TSVs a way to... Closed
Related
is related to TOOLS-90 mongoexport should support TSV Accepted
Operating System: ALL
Participants:

 Description   

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()

{ "_id" : ObjectId("5147741f12da7a6b27ff5c58"), "a" : "true" }

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\"".


Generated at Thu Feb 08 03:19:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.