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

Datetimes before the epoch are exported as $numberLong

    XMLWordPrintable

    Details

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

      Description

      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" } }

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: