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

mongoimport fails to import CSV when field value is a full stop "."

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.9.1
    • Affects Version/s: 1.6.5
    • Component/s: Tools
    • Labels:
      None
    • Fully Compatible
    • ALL

      I am having a problem using mongoimport when the data value is a full stop.
      It appears the full stop "." is translated to 0 during the insert

      Example file
      "name","value"
      "Hello","."

      Import command
      mongoimport --db test --collection dottest --type csv --headerline --file world.csv

      Result on MongoDB
      > db.dottest.find();

      { "_id" : ObjectId("4d67d6cb4e6aea4032d2230e"), "name" : "Hello", "value" : 0, "field2" : "e\"" }

      It seems like the "." is being treated as two fields, the first having value 0 and the second "e\""

      I don't have this problem if I insert from a Mongo session
      db.dottest.save(

      {"name":"Hello","value":"."}

      );
      works fine

      Or if I use mongoimport and the full stop appears with other text "Hello","Mr." will load fine

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            doug_b Doug Braidwood
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: