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

mongoimport error fields cannot be identical

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.8, 3.2.1
    • mongoimport
    • None
    • MongoLab (3.0.8) and Windows 10 (3.2.1)

    Description

      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

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: