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

mongoimport regression in $date handling

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: mongoimport
    • None

      All versions of mongoimport were able to parse and import following simple document containing timestamp:

      { "ts" : { "$date" : "2019-07-25T20:25:15.202+0800" } }
      

      Now if I try to import this document using mongoimport version 4.2.0-rc4 it will print this error:

      2019-07-26T18:30:06.927+0800 connected to: mongodb://localhost:27017/
      2019-07-26T18:30:06.928+0800 Failed: invalid $date value string: 
      2019-07-26T18:30:06.928+0800 0 document(s) imported successfully. 0 document(s) failed to import.
      

      The problem is that new mongoimport only accepts date strings with colon in the timezone offset part. So following document will be imported successfully:

      { "ts" : { "$date" : "2019-07-25T20:25:15.202+08:00" } }
      

      I believe this is a regression in mongoimport functionality comparing to previous versions.

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            igorsol Igor Solodovnikov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: