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

Trailing commas are not ignored by mongoimport. Fields with empty values are created

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.9.2
    • Component/s: Tools
    • Labels:
      None
    • Environment:
      mongodb 1.9.2 on OS X 64

      sridhar-macpro:test sridhar$ cat test.csv
      name,location
      "Chris","Right here",
      "Delta","Right here and here" , , , ,

      mongoimport -d test -c test -type csv --file ./test.csv --drop --headerline

      > db.test.find()

      { "_id" : ObjectId("4e4d8b1df037a08ef9273a18"), "name" : "Chris", "location" : "Right here", "field2" : "" } { "_id" : ObjectId("4e4d8b1df037a08ef9273a19"), "name" : "Delta", "location" : "Right here and here", "field2" : "", "field3" : "", "field4" : "", "field5" : "" }

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            sridhar Sridhar Nanjundeswaran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: