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

mongoimport error fields cannot be identical

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.8, 3.2.1
    • Component/s: mongoimport
    • Labels:
      None
    • Environment:
      MongoLab (3.0.8) and Windows 10 (3.2.1)

      mongoimport fails to import the CSV file on both version 3.0.8 on MongoLab and on my local install of 3.2.1 on Windows.

      C:\Users\user\path\data>mongoimport -d test -c City --file City.csv --type csv --headerline
      2016-01-14T19:24:24.986-0600    Failed: fields cannot be identical: '-109.708244' and '-109.708244'
      2016-01-14T19:24:24.987-0600    imported 0 documents
      

      Workaround: Can import the file if I separate it where the identical values are in different files.

      C:\Users\user\path\data>mongoimport -d test -c City --file City1.csv --type csv --headerline
      2016-01-14T19:27:18.099-0600    connected to: localhost
      2016-01-14T19:27:18.118-0600    imported 485 documents
      
      C:\Users\user\path\data>mongoimport -d test -c City --file City2.csv --type csv --headerline
      2016-01-14T19:27:21.321-0600    connected to: localhost
      2016-01-14T19:27:21.323-0600    imported 20 documents
      

      Attached the CSV files to show that nothing is wrong with City.csv and that City1.csv + City2.csv = City.csv, but mongoimport cannot handle City.csv

        1. City.csv
          37 kB
        2. City1.csv
          36 kB
        3. City2.csv
          2 kB

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            DavidRuhmann David Ruhmann [X]
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: