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

Datetimes before the epoch are exported as $numberLong

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

      In SERVER-11813 mongoexport was changed to output BSON datetime as a string instead of an integer. Apparently this change was never made for datetimes before the epoch.

      From the shell:

      repl0:PRIMARY> db.bar.find()
      { "_id" : ObjectId("5418b3d2fba5220c4bff1a1b"), "dt" : ISODate("1969-12-31T16:00:00Z") }
      { "_id" : ObjectId("5418b3f0fba5220c4bff1a1c"), "dt" : ISODate("1970-01-01T00:00:00Z") }
      

      mongoexport:

      $ ./mongoexport -d foo -c bar
      connected to: 127.0.0.1
      { "_id" : { "$oid" : "5418b3d2fba5220c4bff1a1b" }, "dt" : { "$date" : { "$numberLong" : "-28800000" } } }
      { "_id" : { "$oid" : "5418b3f0fba5220c4bff1a1c" }, "dt" : { "$date" : "1969-12-31T16:00:00.000-0800" } }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: