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

XMLWordPrintableJSON

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

      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 Brody (Inactive)
            Reporter:
            Sridhar Nanjundeswaran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: