Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-745

Importing CSV mongoimport forces quoted strings into other types

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.3, 3.1.2
    • mongoimport

    Description

      (this is not new but it's very frustrating)

      Using mongoimport with CSV file where every field is quoted and therefore expected to be imported as strings, instead mongimport seems to coerce the strings into other values, in particular numbers.

      So I have fields with values "10010", "10112", "10934","94107-1745", "" and I end up with three numbers and two strings.

      This is rather unfortunate - if I wanted them as numbers, why would I have quoted them? If I import the same thing without quotes, I get numbers, so shouldn't adding quotes have some effect?

      Attachments

        Activity

          People

            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: