Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9015

Mongoimport for TSVs does not understand types correctly

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Duplicate
    • None
    • None
    • Tools
    • None
    • ALL

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              andrew.emil@10gen.com Andrew Emil
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: