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

Timestamp(0,0) not filled in for _id field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • None
    • None
    • None
    • None
    • ALL
    • Query 2019-10-07, Query 2019-10-21

    Description

      asdf:PRIMARY> db.foo.insert({_id: Timestamp(0,0)})
      WriteResult({ "nInserted" : 1 })
      asdf:PRIMARY> db.foo.insert({_id: 1, x: Timestamp(0,0)})
      WriteResult({ "nInserted" : 1 })
      asdf:PRIMARY> db.foo.insert({_id: 2, w: 1, x: Timestamp(0,0)})
      WriteResult({ "nInserted" : 1 })
      asdf:PRIMARY> db.foo.find()
      { "_id" : Timestamp(0, 0) }
      { "_id" : 1, "x" : Timestamp(1566529153, 1) }
      { "_id" : 2, "w" : 1, "x" : Timestamp(1566529173, 1) }
      

      The documentation says "Changed in version 2.6: Previously, the server would only replace empty timestamp values in the first two fields, including _id, of an inserted document. Now MongoDB will replace any top-level field." So either the server or the docs have a bug. https://docs.mongodb.com/manual/reference/bson-types/#timestamps

      Attachments

        Issue Links

          Activity

            People

              bernard.gorman@mongodb.com Bernard Gorman
              mathias@mongodb.com Mathias Stearn
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: