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

Timestamp constructor in shell should take seconds instead of milliseconds

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.4.0-rc2
    • None
    • None
    • Major Change
    • ALL

    Description

      Behavior:
      mongos> db.test.insert(

      {"t":new Timestamp(1234,5678)}

      )
      mongos> db.test.find()
      { "_id" : ObjectId("50a410317d03635de69f66eb"), "t" :

      { "t" : 1000, "i" : 5678 }

      }
      mongos>
      Reason:
      Timestamps are stored as seconds, but the shell divides by 1000 on the way in and multiplies by 1000 on the way out.

      Fix:
      Change constructor to take first param as seconds, not millis, and error if the value is greater than the maximum unix time in seconds (seconds between 1970 and 2038).

      Attachments

        Activity

          People

            scotthernandez Scott Hernandez (Inactive)
            sverch Shaun Verch
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: