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

mongoimport regression in $date handling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mongoimport
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: