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

Datetimes close to the epoch can not be round tripped using mongoexport and mongoimport

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc2
    • Affects Version/s: None
    • Component/s: None
    • None

      It seems that datetimes are export using localtime.

      repl0:PRIMARY> db.bar.find()
      { "_id" : ObjectId("5418c8d2fba52216ba4ca523"), "dt" : ISODate("1970-01-01T00:00:00Z") }
      
      ./mongoexport -d foo -c bar -o foo.json
      connected to: 127.0.0.1
      exported 1 records
      cat foo.json 
      { "_id" : { "$oid" : "5418c8d2fba52216ba4ca523" }, "dt" : { "$date" : "1969-12-31T16:00:00.000-0800" } }
      
      ./mongoimport -d foo -c bim --file foo.json
      connected to: 127.0.0.1
      exception:BSON representation of supplied JSON is too large: code BadValue: BadValue: Year out of range:  1969
      2014-09-16T16:36:12.215-0700 check 0 0
      2014-09-16T16:36:12.215-0700 imported 0 objects
      encountered 1 error(s)
      

            Assignee:
            mikeo@mongodb.com Michael O'Brien
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: