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

Weird problem with mongoimport

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0
    • Affects Version/s: 1.8.1
    • Component/s: Tools
    • None
    • Linux

      I'm using mongoimport to load data form CSV file (see attached file for details).

      Command is following
      mongoimport -u mongoUSER -p 'password1' -c usr_payments export.csv --type csv --stopOnError --upsert -f fld1,fld2,fld3,fld4,fld5,fld6,_id,fld7,fld8,fld9,fld10,fld11,fld12,fld14,fld15,fld17,fld18,fld19,fld20,fld21,fld22,fld23,fld24,fld25

      The problem appears when i try to preview data from mongo client. When i execute db.usr_payments.find(); after import i get following output.

      { "fld1" : NumberLong("983985673146990594"), "fld2" : NumberLong("1316445833024"), "fld3" : 0, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468001), "fld7" : 1558001, "fld8" : 1, "fld9" : 1167014, "fld10" : 1000001, "fld11" : NumberLong(47813324), "fld12" : NumberLong(47788324), "fld14" : NumberLong(24068021), "fld15" : NumberLong(24093021), "fld17" : 435, "fld18" : 26, "fld19" : 1, "fld20" : 1, "fld21" : 63, "fld22" : "USD", "fld23" : 25000, "fld24" : 0, "fld25" : 3 } { "fld1" : NumberLong("983985673146990594"), "fld2" : NumberLong("1316445833024"), "fld3" : 1, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468004), "fld7" : 1558001, "fld8" : 4, "fld9" : 1167014, "fld10" : 1000001, "fld11" : NumberLong(47788324), "fld12" : NumberLong(47778324), "fld14" : NumberLong(24093021), "fld15" : NumberLong(24103021), "fld17" : 435, "fld18" : 26, "fld19" : 1, "fld20" : 1, "fld21" : 63, "fld22" : "USD", "fld23" : 10000, "fld24" : 0, "fld25" : 3 } { "fld1" : NumberLong("983985673146990594"), "fld2" : NumberLong("1316445833024"), "fld3" : 2, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468003), "fld7" : 1558001, "fld8" : 3, "fld9" : 1167014, "fld10" : 1002001, "fld11" : NumberLong(47778324), "fld12" : NumberLong(47763324), "fld14" : 103000, "fld15" : 118000, "fld17" : 435, "fld18" : 2, "fld19" : 1, "fld20" : 1, "fld21" : 63, "fld22" : "USD", "fld23" : 15000, "fld24" : 0, "fld25" : 3, "field24" : "", "field25" : 3 } { "fld1" : NumberLong("983985673146990594"), "fld2" : NumberLong("1316445833024"), "fld3" : 3, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468002), "fld7" : 1558001, "fld8" : 2, "fld9" : 1167014, "fld10" : 1002001, "fld11" : NumberLong(47763324), "fld12" : NumberLong(47763324), "fld14" : 118000, "fld15" : 118000, "fld17" : 435, "fld18" : 2, "fld19" : 1, "fld20" : 1, "fld21" : 63, "fld22" : "USD", "fld23" : 0, "fld24" : 0, "fld25" : 3, "field24" : 3, "field25" : "", "field26" : 3 } { "fld1" : NumberLong("983992507840856066"), "fld2" : NumberLong("1316446647783"), "fld3" : 4, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468005), "fld7" : 1558002, "fld8" : 1, "fld9" : 1167014, "fld10" : 1000001, "fld11" : NumberLong(47763324), "fld12" : NumberLong(47741657), "fld14" : NumberLong(24103021), "fld15" : NumberLong(24124688), "fld17" : 435, "fld18" : 26, "fld19" : 1, "fld20" : 1, "fld21" : 61, "fld22" : "USD", "fld23" : 21667, "fld24" : 0, "fld25" : 3 } { "fld1" : NumberLong("983992507840856066"), "fld2" : NumberLong("1316446647783"), "fld3" : 5, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468008), "fld7" : 1558002, "fld8" : 4, "fld9" : 1167014, "fld10" : 1000001, "fld11" : NumberLong(47741657), "fld12" : NumberLong(47732990), "fld14" : NumberLong(24124688), "fld15" : NumberLong(24133355), "fld17" : 435, "fld18" : 26, "fld19" : 1, "fld20" : 1, "fld21" : 61, "fld22" : "USD", "fld23" : 8667, "fld24" : 0, "fld25" : 3 } { "fld1" : NumberLong("983992507840856066"), "fld2" : NumberLong("1316446647783"), "fld3" : 6, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468007), "fld7" : 1558002, "fld8" : 3, "fld9" : 1167014, "fld10" : 1002001, "fld11" : NumberLong(47732990), "fld12" : NumberLong(47719990), "fld14" : 118000, "fld15" : 131000, "fld17" : 435, "fld18" : 2, "fld19" : 1, "fld20" : 1, "fld21" : 61, "fld22" : "USD", "fld23" : 13000, "fld24" : 0, "fld25" : 3, "field24" : 3 } { "fld1" : NumberLong("983992507840856066"), "fld2" : NumberLong("1316446647783"), "fld3" : 7, "fld4" : 0, "fld5" : 1, "fld6" : 1, "_id" : NumberLong(20468006), "fld7" : 1558002, "fld8" : 2, "fld9" : 1167014, "fld10" : 1002001, "fld11" : NumberLong(47719990), "fld12" : NumberLong(47719990), "fld14" : 131000, "fld15" : 131000, "fld17" : 435, "fld18" : 2, "fld19" : 1, "fld20" : 1, "fld21" : 61, "fld22" : "USD", "fld23" : 0, "fld24" : 0, "fld25" : 3, "field24" : 3, "field25" : 3 }

      There are some records in output that contain fields "field24" and "field25". I can't understand how they appears in collection? The CSV file seems to be well formatted and i get no errors on import?

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            denis.sytenkov Denis Sytenkov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: